summaryrefslogtreecommitdiff
path: root/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c
diff options
context:
space:
mode:
authorepaew <epaew@users.noreply.github.com>2018-07-08 21:11:02 +0900
committerDrashna Jaelre <drashna@live.com>2018-07-08 05:11:02 -0700
commit0b9b2a6376df286d3a5bc44a99274dc196524fc1 (patch)
treec8b6077d6e8a5573583ec200986c45a2762e8cb9 /keyboards/helix/rev2/keymaps/edvorakjp/keymap.c
parentf28f5696005bdc51b9d1ff3a59c70bf47b8b897a (diff)
Add edvorakjp keymap for the Helix (rev2) keyboard (#3340)
* add readme.md * add extern declaration of edvorakjp_config to edvorakjp.h * add oled.c * add layout definitions * add keymap.c * add rules.mk * fix rgblight issue: rgblight_setrgb() ignore RGBLIGHT_LIMIT_VAL
Diffstat (limited to 'keyboards/helix/rev2/keymaps/edvorakjp/keymap.c')
-rw-r--r--keyboards/helix/rev2/keymaps/edvorakjp/keymap.c61
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 0000000000..650a39115a
--- /dev/null
+++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c
@@ -0,0 +1,61 @@
+#include QMK_KEYBOARD_H
+#include "split_util.h"
+#include "keymap_xrows.h"
+#ifdef SSD1306OLED
+ #include "oled.h"
+#endif
+
+// keymaps definitions are moved to keymap_Xrows.c.
+
+bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
+ switch(keycode) {
+ case KC_LOCK:
+ if (record->event.pressed) {
+ if (edvorakjp_config.enable_kc_lang) {
+ SEND_STRING( SS_LCTRL(SS_LSFT(SS_TAP(X_POWER))) );
+ } else {
+ SEND_STRING( SS_LGUI("l") );
+ }
+ }
+ return false;
+ }
+ return true;
+}
+
+#ifdef SSD1306OLED
+void matrix_init_keymap(void) {
+ //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
+ iota_gfx_init(!has_usb()); // turns on the display
+}
+
+void matrix_scan_user(void) {
+ iota_gfx_task(); // this is what updates the display continuously
+}
+#endif
+
+#ifdef RGBLIGHT_ENABLE
+uint32_t layer_state_set_keymap(uint32_t state) {
+ rgblight_mode_noeeprom(1);
+ switch (biton32(state)) {
+ case _EDVORAKJ1:
+ case _EDVORAKJ2:
+ // _EDVORAKJ1 & J2 are same colored
+ rgblight_sethsv_noeeprom_white();
+ break;
+ case _LOWER:
+ rgblight_sethsv_noeeprom_red();
+ break;
+ case _RAISE:
+ rgblight_sethsv_noeeprom_blue();
+ break;
+ case _ADJUST:
+ rgblight_sethsv_noeeprom_green();
+ break;
+ default: // for any other layers, or the default layer
+ rgblight_mode_noeeprom(28);
+ rgblight_sethsv_noeeprom_red();
+ break;
+ }
+ return state;
+}
+#endif