diff options
Diffstat (limited to 'keyboards/helix/rev2/keymaps/edvorakjp/keymap.c')
| -rw-r--r-- | keyboards/helix/rev2/keymaps/edvorakjp/keymap.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c b/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c new file mode 100644 index 000000000..650a39115 --- /dev/null +++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | #include QMK_KEYBOARD_H | ||
| 2 | #include "split_util.h" | ||
| 3 | #include "keymap_xrows.h" | ||
| 4 | #ifdef SSD1306OLED | ||
| 5 | #include "oled.h" | ||
| 6 | #endif | ||
| 7 | |||
| 8 | // keymaps definitions are moved to keymap_Xrows.c. | ||
| 9 | |||
| 10 | bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { | ||
| 11 | switch(keycode) { | ||
| 12 | case KC_LOCK: | ||
| 13 | if (record->event.pressed) { | ||
| 14 | if (edvorakjp_config.enable_kc_lang) { | ||
| 15 | SEND_STRING( SS_LCTRL(SS_LSFT(SS_TAP(X_POWER))) ); | ||
| 16 | } else { | ||
| 17 | SEND_STRING( SS_LGUI("l") ); | ||
| 18 | } | ||
| 19 | } | ||
| 20 | return false; | ||
| 21 | } | ||
| 22 | return true; | ||
| 23 | } | ||
| 24 | |||
| 25 | #ifdef SSD1306OLED | ||
| 26 | void matrix_init_keymap(void) { | ||
| 27 | //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h | ||
| 28 | iota_gfx_init(!has_usb()); // turns on the display | ||
| 29 | } | ||
| 30 | |||
| 31 | void matrix_scan_user(void) { | ||
| 32 | iota_gfx_task(); // this is what updates the display continuously | ||
| 33 | } | ||
| 34 | #endif | ||
| 35 | |||
| 36 | #ifdef RGBLIGHT_ENABLE | ||
| 37 | uint32_t layer_state_set_keymap(uint32_t state) { | ||
| 38 | rgblight_mode_noeeprom(1); | ||
| 39 | switch (biton32(state)) { | ||
| 40 | case _EDVORAKJ1: | ||
| 41 | case _EDVORAKJ2: | ||
| 42 | // _EDVORAKJ1 & J2 are same colored | ||
| 43 | rgblight_sethsv_noeeprom_white(); | ||
| 44 | break; | ||
| 45 | case _LOWER: | ||
| 46 | rgblight_sethsv_noeeprom_red(); | ||
| 47 | break; | ||
| 48 | case _RAISE: | ||
| 49 | rgblight_sethsv_noeeprom_blue(); | ||
| 50 | break; | ||
| 51 | case _ADJUST: | ||
| 52 | rgblight_sethsv_noeeprom_green(); | ||
| 53 | break; | ||
| 54 | default: // for any other layers, or the default layer | ||
| 55 | rgblight_mode_noeeprom(28); | ||
| 56 | rgblight_sethsv_noeeprom_red(); | ||
| 57 | break; | ||
| 58 | } | ||
| 59 | return state; | ||
| 60 | } | ||
| 61 | #endif | ||
