Adding Custom Shift Key Implementation for BriianPowell's Gentleman65 Keymap (#21315)

This commit is contained in:
Brian
2023-07-07 07:33:08 -07:00
committed by GitHub
parent 9f4f1de001
commit ea9fa4c648
6 changed files with 183 additions and 4 deletions

View File

@@ -14,6 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
#include "features/custom_shift_keys.h"
#define FN_ESC LT(_FUNC, KC_ESC)
@@ -29,6 +30,10 @@ enum gentleman_keycodes {
FUNC,
};
const custom_shift_key_t custom_shift_keys[] = {{KC_ESC, KC_TILD}};
uint8_t NUM_CUSTOM_SHIFT_KEYS = sizeof(custom_shift_keys) / sizeof(custom_shift_key_t);
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_65_ansi_rwkl_split_bs(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_TRNS,
@@ -78,6 +83,9 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (!process_custom_shift_keys(keycode, record)) {
return false;
}
switch (keycode) {
case QWERTY:
if (record->event.pressed) {
@@ -90,7 +98,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
}
return true;
}