summaryrefslogtreecommitdiffstats
path: root/keyboards/planck
diff options
context:
space:
mode:
authorCallum Oakley <c.oakley108@gmail.com>2016-08-12 22:05:52 +0200
committerCallum Oakley <c.oakley108@gmail.com>2016-08-12 22:05:52 +0200
commit993d72b11fca8d50296570dc85e9354f8045c4a6 (patch)
treebfff0cb65697313b781f4c45f0ff87a9cef144cb /keyboards/planck
parent49fbcb3e7cea2d47df6350918ff6e00960a78b15 (diff)
downloadqmk_firmware-993d72b11fca8d50296570dc85e9354f8045c4a6.tar.gz
qmk_firmware-993d72b11fca8d50296570dc85e9354f8045c4a6.tar.xz
added a lock screen key
Diffstat (limited to 'keyboards/planck')
-rw-r--r--keyboards/planck/keymaps/callum/keymap.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c
index ed187df1d..494ed30b0 100644
--- a/keyboards/planck/keymaps/callum/keymap.c
+++ b/keyboards/planck/keymaps/callum/keymap.c
@@ -20,7 +20,8 @@ enum planck_keycodes {
BASE = SAFE_RANGE,
MOVE,
SYMB,
- FUNC
+ FUNC,
+ LOCK
};
// Fillers to make layering more clear
@@ -87,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ,-----------------------------------------------------------------------------------.
* | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 |
* |-----------------------------------------------------------------------------------.
- * | | Play | Prev | Next | BL+ | | | | | | | |
+ * | | Play | Prev | Next | BL+ | | | Lock | | | | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | Mute | Vol- | Vol+ | BL- | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
@@ -96,7 +97,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_FUNC] = {
{KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 },
- {_______, KC_MPLY, KC_MPRV, KC_MNXT, KC_PAUS, _______, _______, _______, _______, _______, _______, _______},
+ {_______, KC_MPLY, KC_MPRV, KC_MNXT, KC_PAUS, _______, _______, LOCK, _______, _______, _______, _______},
{_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_SLCK, _______, _______, _______, _______, _______, _______, _______},
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET }
}
@@ -133,6 +134,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
+ case LOCK:
+ if (record->event.pressed) {
+ register_code(KC_RSFT);
+ register_code(KC_RGUI);
+ register_code(KC_POWER);
+ } else {
+ unregister_code(KC_POWER);
+ unregister_code(KC_RGUI);
+ unregister_code(KC_RSFT);
+ }
+ return false;
+ break;
}
return true;
}