X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=keyboards%2Fplanck%2Fkeymaps%2Fcallum%2Fkeymap.c;h=494ed30b06d648760ee232c11ad17d8940bd7fb4;hb=993d72b11fca8d50296570dc85e9354f8045c4a6;hp=ed187df1da3a140464a9ab3ca479f0a348764e91;hpb=49fbcb3e7cea2d47df6350918ff6e00960a78b15;p=qmk_firmware.git 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; }