diff options
Diffstat (limited to 'keyboards/hub16/keymaps/no_mod/keymap.c')
| -rwxr-xr-x | keyboards/hub16/keymaps/no_mod/keymap.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/keyboards/hub16/keymaps/no_mod/keymap.c b/keyboards/hub16/keymaps/no_mod/keymap.c new file mode 100755 index 000000000..c86ffcc16 --- /dev/null +++ b/keyboards/hub16/keymaps/no_mod/keymap.c | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | /* Copyright 2019 Josh Johnson | ||
| 2 | * | ||
| 3 | * This program is free software: you can redistribute it and/or modify | ||
| 4 | * it under the terms of the GNU General Public License as published by | ||
| 5 | * the Free Software Foundation, either version 2 of the License, or | ||
| 6 | * (at your option) any later version. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License | ||
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 15 | */ | ||
| 16 | #include QMK_KEYBOARD_H | ||
| 17 | |||
| 18 | // Function key we are 'wrapping' usual key presses in | ||
| 19 | #define KC_WRAP KC_F24 | ||
| 20 | |||
| 21 | // Tap Dance Declarations | ||
| 22 | enum { TD_TO_LED = 0, TD_TO_DEFAULT = 1 }; | ||
| 23 | |||
| 24 | qk_tap_dance_action_t tap_dance_actions[] = { | ||
| 25 | // Tap once for HID, twice to toggle layer 1 | ||
| 26 | [TD_TO_LED] = ACTION_TAP_DANCE_DUAL_ROLE(_______, 1), | ||
| 27 | [TD_TO_DEFAULT] = ACTION_TAP_DANCE_DUAL_ROLE(_______, 0)}; | ||
| 28 | |||
| 29 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
| 30 | [0] = LAYOUT( /* Base */ | ||
| 31 | KC_S, KC_V, | ||
| 32 | KC_A, KC_B, KC_C, KC_D, | ||
| 33 | KC_E, KC_F, KC_G, KC_H, | ||
| 34 | KC_I, KC_J, KC_K, KC_L, | ||
| 35 | KC_M, KC_N, KC_O, TD(TD_TO_LED) | ||
| 36 | ), | ||
| 37 | |||
| 38 | [1] = LAYOUT( /* LED Control */ | ||
| 39 | KC_NO, KC_NO, | ||
| 40 | _______, RGB_MOD, RGB_RMOD, RGB_TOG, | ||
| 41 | RGB_VAD, RGB_VAI, RGB_HUD, RGB_HUI, | ||
| 42 | RGB_SAD, RGB_SAI, _______, _______, | ||
| 43 | _______, _______, RESET, TD(TD_TO_DEFAULT) | ||
| 44 | ), | ||
| 45 | }; | ||
| 46 | |||
| 47 | // Keyboard is setup to 'warp' the pressed key with F24, | ||
| 48 | // allowing for easy differentiation from a real keyboard. | ||
| 49 | void encoder_update_user(uint8_t index, bool clockwise) { | ||
| 50 | if (index == 0) { /* Left Encoder */ | ||
| 51 | if (clockwise) { | ||
| 52 | tap_code(KC_R); | ||
| 53 | } else { | ||
| 54 | tap_code(KC_Q); | ||
| 55 | } | ||
| 56 | } else if (index == 1) { /* Right Encoder */ | ||
| 57 | if (clockwise) { | ||
| 58 | tap_code(KC_U); | ||
| 59 | } else { | ||
| 60 | tap_code(KC_T); | ||
| 61 | } | ||
| 62 | } | ||
| 63 | } \ No newline at end of file | ||
