diff options
author | tmk <nobody@nowhere> | 2013-01-27 16:38:19 +0900 |
---|---|---|
committer | tmk <nobody@nowhere> | 2013-01-27 16:38:19 +0900 |
commit | bfd7fe586297d70f824a402fd476c3daa889fa56 (patch) | |
tree | c903d4a878aa7317ca3c2bb62ece03fdb745d51b /keyboard/hhkb | |
parent | 66d5dd284271d85da4c161529e12526b50b0f71d (diff) | |
download | qmk_firmware-bfd7fe586297d70f824a402fd476c3daa889fa56.tar.gz qmk_firmware-bfd7fe586297d70f824a402fd476c3daa889fa56.zip |
Add oneshot modifier action.
Diffstat (limited to 'keyboard/hhkb')
-rw-r--r-- | keyboard/hhkb/keymap.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/keyboard/hhkb/keymap.c b/keyboard/hhkb/keymap.c index e4eeb3e39f..b74dc71ba5 100644 --- a/keyboard/hhkb/keymap.c +++ b/keyboard/hhkb/keymap.c @@ -61,6 +61,8 @@ static const uint16_t PROGMEM fn_actions[] = { ACTION_LAYER_SET_TAP_KEY(5, KC_SPC), // Fn5 ACTION_LMODS_TAP(MOD_BIT(KC_LCTL), KC_BSPC), // Fn6 ACTION_RMODS_TAP(MOD_BIT(KC_RCTL), KC_ENT), // Fn7 + + ACTION_LMODS_TAP(MOD_BIT(KC_LSFT), ONE_SHOT), // Fn8 }; @@ -81,7 +83,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSLS,GRV, \ TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ FN6, A, S, D, F, G, H, J, K, L, FN3, QUOT,FN7, \ - LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT,FN1, \ + FN8, Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT,FN1, \ LGUI,LALT, FN5, RALT,FN4), /* Layer 1: HHKB mode (HHKB Fn) @@ -205,8 +207,12 @@ action_t keymap_get_action(uint8_t layer, uint8_t row, uint8_t col) { action.code = ACTION_RMODS(MOD_BIT(key)>>4); break; */ - case KC_FN0 ... KC_FN7: - action.code = pgm_read_word(&fn_actions[FN_INDEX(key)]); + case KC_FN0 ... FN_MAX: + if (FN_INDEX(key) < sizeof(fn_actions) / sizeof(fn_actions[0])) { + action.code = pgm_read_word(&fn_actions[FN_INDEX(key)]); + } else { + action.code = ACTION_NO; + } break; case KC_NO ... KC_UNDEFINED: default: |