summaryrefslogtreecommitdiffstats
path: root/keyboards/handwired/gamenum/keymaps/default/keymap.c
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-02-15 15:07:13 +1100
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-02-14 20:07:13 -0800
commit9e4ac6cf29e6b2ce950135c8f877c95f2d1f1d55 (patch)
treedf6cfe88ce0f51ea5ca7fd6b93aae7eaed67d8a5 /keyboards/handwired/gamenum/keymaps/default/keymap.c
parentd5bc7fc1575543eb27cffcc465a8f0c4e11b7de7 (diff)
Migrate fn_actions for default keymaps (#4935)
* Migrate fn_actions for default keymaps * Rename the Grave/Escape Shift masks * No need for shift_esc_shift_mask * Change breaks to return false * Right align pointers * Add default case * Separate cases with empty lines
Diffstat (limited to 'keyboards/handwired/gamenum/keymaps/default/keymap.c')
-rw-r--r--keyboards/handwired/gamenum/keymaps/default/keymap.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/keyboards/handwired/gamenum/keymaps/default/keymap.c b/keyboards/handwired/gamenum/keymaps/default/keymap.c
index a18ffc89b9..7d667cd390 100644
--- a/keyboards/handwired/gamenum/keymaps/default/keymap.c
+++ b/keyboards/handwired/gamenum/keymaps/default/keymap.c
@@ -7,21 +7,21 @@
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[DEF] = LAYOUT(
- KC_FN0, KC_SLSH, KC_ASTR, KC_MINS, \
+ TO(HDN), KC_SLSH, KC_ASTR, KC_MINS, \
KC_7, KC_8, KC_9, KC_PLUS, \
KC_4, KC_5, KC_6, \
KC_1, KC_2, KC_3, \
KC_0, KC_DOT, KC_ENT \
),
[HDN] = LAYOUT(
- KC_FN1, KC_1, KC_2, KC_3, \
+ TO(OSY), KC_1, KC_2, KC_3, \
KC_Q, KC_W, KC_E, KC_R, \
KC_A, KC_S, KC_D, \
KC_Z, KC_X, KC_C, \
KC_LSFT, KC_LALT, KC_SPC \
),
[OSY] = LAYOUT(
- KC_A, KC_Q, KC_1, KC_FN2, \
+ KC_A, KC_Q, KC_1, TO(DEF), \
KC_S, KC_W, KC_2, KC_LALT, \
KC_D, KC_E, KC_3, \
KC_F, KC_R, KC_4, \
@@ -29,36 +29,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
)
};
-
-const uint16_t PROGMEM fn_actions[] = {
- [0] = ACTION_LAYER_SET(HDN, ON_PRESS),
- [1] = ACTION_LAYER_SET(OSY, ON_PRESS),
- [2] = ACTION_LAYER_SET(DEF, ON_PRESS),
-};
-
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
return MACRO_NONE;
};
-bool process_record_user (uint16_t keycode, keyrecord_t *record) {
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
- case KC_FN0:
- if (record->event.pressed) {
- PORTC |= (1 << 6); // PC6 goes high
- }
- break;
- case KC_FN1:
- if (record->event.pressed) {
- PORTC &= ~(1 << 6); // PC6 goes high
- PORTD |= (1<<4);
- }
- break;
- case KC_FN2:
- if (record->event.pressed) {
- PORTD &= ~(1 << 4); // PC6 goes high
- }
- break;
+ case TO(HDN):
+ if (record->event.pressed) {
+ PORTC |= (1 << 6); // PC6 goes high
+ }
+
+ return true;
+
+ case TO(OSY):
+ if (record->event.pressed) {
+ PORTC &= ~(1 << 6); // PC6 goes high
+ PORTD |= (1<<4);
+ }
+
+ return true;
+
+ case TO(DEF):
+ if (record->event.pressed) {
+ PORTD &= ~(1 << 4); // PC6 goes high
+ }
+
+ return true;
+
+ default:
+ return true;
}
- return true;
}