diff options
author | Ryan <fauxpark@gmail.com> | 2021-07-15 03:52:45 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-15 03:52:45 +1000 |
commit | fd8628ccdc97482aae1814cec5c2059c2978daad (patch) | |
tree | b4cb8d8811023236254ddd631bc45120bcd2bb84 /keyboards/whitefox/keymaps | |
parent | e69c325a9ce84bc144dbc89978f800fc7560757d (diff) |
Migrate more `fn_actions` stuff (#13502)
Diffstat (limited to 'keyboards/whitefox/keymaps')
-rw-r--r-- | keyboards/whitefox/keymaps/kim-kim/keymap.c | 15 | ||||
-rw-r--r-- | keyboards/whitefox/keymaps/matt3o/keymap.c | 60 |
2 files changed, 43 insertions, 32 deletions
diff --git a/keyboards/whitefox/keymaps/kim-kim/keymap.c b/keyboards/whitefox/keymaps/kim-kim/keymap.c index a254067582..baaa136873 100644 --- a/keyboards/whitefox/keymaps/kim-kim/keymap.c +++ b/keyboards/whitefox/keymaps/kim-kim/keymap.c @@ -51,18 +51,3 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______,_______, _______, _______,_______,_______, KC_HOME,_______,KC_END \ ), }; - -/* Give numbers some descriptive names */ -#define ACTION_LEDS_ALL 1 -#define ACTION_LEDS_GAME 2 - -const uint16_t fn_actions[] = { - [2] = ACTION_FUNCTION(ACTION_LEDS_ALL), - [3] = ACTION_FUNCTION(ACTION_LEDS_GAME), - - [4] = ACTION_USAGE_CONSUMER(0x1B4), - [5] = ACTION_USAGE_CONSUMER(0x196), - [6] = ACTION_USAGE_CONSUMER(0x1A6), - [7] = ACTION_USAGE_CONSUMER(0x1A0), - -}; diff --git a/keyboards/whitefox/keymaps/matt3o/keymap.c b/keyboards/whitefox/keymaps/matt3o/keymap.c index f6987fe1aa..bb84196684 100644 --- a/keyboards/whitefox/keymaps/matt3o/keymap.c +++ b/keyboards/whitefox/keymaps/matt3o/keymap.c @@ -16,6 +16,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include QMK_KEYBOARD_H +enum custom_keycodes { + AL_FILE = SAFE_RANGE, + AL_WWW, + AL_HELP, + AL_CMD +}; + const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer * ,---------------------------------------------------------------. @@ -45,25 +52,44 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_HOME,KC_PGDN,KC_END \ ), [2] = LAYOUT( \ - KC_SLEP,KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_FN2, \ - KC_TRNS,KC_TRNS,KC_FN5 ,KC_FN6 ,KC_TRNS,KC_FN7 ,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_TRNS,KC_TRNS,KC_TRNS, KC_FN3, \ - KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_FN4 ,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,\ + KC_SLEP,KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_NO, \ + KC_TRNS,KC_TRNS,AL_WWW ,AL_HELP ,KC_TRNS,AL_CMD ,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_TRNS,KC_TRNS,KC_TRNS, KC_NO, \ + KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,AL_FILE ,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,\ KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_CALC,KC_TRNS,KC_TRNS,KC_TRNS,KC_MAIL,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,\ KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS \ ), }; -/* Give numbers some descriptive names */ -#define ACTION_LEDS_ALL 1 -#define ACTION_LEDS_GAME 2 - -const uint16_t fn_actions[] = { - [2] = ACTION_FUNCTION(ACTION_LEDS_ALL), - [3] = ACTION_FUNCTION(ACTION_LEDS_GAME), - - [4] = ACTION_USAGE_CONSUMER(0x1B4), - [5] = ACTION_USAGE_CONSUMER(0x196), - [6] = ACTION_USAGE_CONSUMER(0x1A6), - [7] = ACTION_USAGE_CONSUMER(0x1A0), - -}; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case AL_FILE: + if (record->event.pressed) { + host_consumer_send(0x1B4); // AL File Browser + } else { + host_consumer_send(0); + } + return false; + case AL_WWW: + if (record->event.pressed) { + host_consumer_send(0x196); // AL Internet Browser + } else { + host_consumer_send(0); + } + return false; + case AL_HELP: + if (record->event.pressed) { + host_consumer_send(0x1A6); // AL Integrated Help Center + } else { + host_consumer_send(0); + } + return false; + case AL_CMD: + if (record->event.pressed) { + host_consumer_send(0x1A0); // AL Command Line Processor/Run + } else { + host_consumer_send(0); + } + return false; + } + return true; +} |