summaryrefslogtreecommitdiffstats
path: root/keyboards/xd75
diff options
context:
space:
mode:
authorKenny Hung <kennysubs+github@outlook.com>2018-06-19 22:04:13 +0200
committerDrashna Jaelre <drashna@live.com>2018-06-19 22:04:13 +0200
commite59bfd3359c554811f1e1769593bf20f7c4fe32f (patch)
tree16111c38221462bc93f1a8f498c116c02483a350 /keyboards/xd75
parent21a277bd8ed3375249ed84c9f7dbbf0706ca6513 (diff)
downloadqmk_firmware-e59bfd3359c554811f1e1769593bf20f7c4fe32f.tar.gz
qmk_firmware-e59bfd3359c554811f1e1769593bf20f7c4fe32f.tar.xz
Some lightshow code for XD75. (#3203)
* Add shift key to navigation layer to save pinky when double tapping shift key in IntelliJ * Fancy effects on the lights
Diffstat (limited to 'keyboards/xd75')
-rw-r--r--keyboards/xd75/keymaps/skewwhiffy/keymap.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/keyboards/xd75/keymaps/skewwhiffy/keymap.c b/keyboards/xd75/keymaps/skewwhiffy/keymap.c
index f2a8418fe..9c3e755f6 100644
--- a/keyboards/xd75/keymaps/skewwhiffy/keymap.c
+++ b/keyboards/xd75/keymaps/skewwhiffy/keymap.c
@@ -126,7 +126,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | | Tab | Left | Down | Right | | | | | | Insert | Home | PgUp | | |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
- * | | ShTab | Alt L | | Alt R | | | | | | ScLk | End | PgDn | | |
+ * | | ShTab | Alt L | Shift | Alt R | | | | | | ScLk | End | PgDn | | |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
* | | | | | | | | | | | | | | | RESET |
* '--------------------------------------------------------------------------------------------------------------------------------------'
@@ -135,7 +135,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ _______, UK_ESC, _C_LEFT, UK_UP , _C_RGHT, _______, _______, _______, _______, _______, UK_PSCR, UK_SLCK, UK_PAUS, _______, _______ },
{ _______, UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, _______, _______, _______, _______, _______, UK_INS, UK_HOME, UK_PGUP, _______, _______ },
- { _______, _S_TAB, _A_LEFT, _______, _A_RGHT, _B_NAV, _______, _______, _______, _K_NAV, UK_SLCK, UK_END, UK_PGDN, _______, _______ },
+ { _______, _S_TAB, _A_LEFT, UK_LSFT, _A_RGHT, _B_NAV, _______, _______, _______, _K_NAV, UK_SLCK, UK_END, UK_PGDN, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET },
},
};
@@ -161,3 +161,51 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
}
return MACRO_NONE;
};
+
+bool CTRLDOWN = false;
+bool ALTDOWN = false;
+bool WINDOWN = false;
+bool SHIFTDOWN = false;
+bool TERMINALOPEN = false;
+
+void matrix_scan_user(void) {
+ if (TERMINALOPEN) {
+ rgblight_effect_rainbow_swirl(128);
+ } else if (SHIFTDOWN) {
+ rgblight_effect_breathing(3);
+ } else if (CTRLDOWN) {
+ rgblight_effect_knight(3);
+ } else if (WINDOWN) {
+ rgblight_effect_snake(3);
+ } else {
+ rgblight_setrgb(0, 0, 0);
+ }
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case UK_LGUI:
+ case UK_RGUI:
+ WINDOWN = record->event.pressed;
+ TERMINALOPEN = false;
+ break;
+ case UK_LCTL:
+ case UK_RCTL:
+ CTRLDOWN = record->event.pressed;
+ break;
+ case UK_LSFT:
+ case UK_RSFT:
+ SHIFTDOWN = record->event.pressed;
+ break;
+ case UK_LALT:
+ case UK_RALT:
+ ALTDOWN = record-> event.pressed;
+ break;
+ case _TERM:
+ if (record->event.pressed) {
+ TERMINALOPEN = !TERMINALOPEN;
+ }
+ break;
+ }
+ return true;
+}