diff options
author | a0-c <g1@porkhash.net> | 2016-04-26 14:05:05 -1000 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2016-04-26 20:05:05 -0400 |
commit | 8fda26db7d4334eaa5018d325b368c40103b198f (patch) | |
tree | 2e674eb2030898a872db064859e68bffb3827aac /keyboard/gh60_rev_c/keymaps | |
parent | e024c11f7a849a38e478cda9fb9939a838cfa2e0 (diff) |
gh60 Rev C with LED controls (#289)
* gh60_rev_c
* gh60 Rev C
Support for WASD, Poker, Esc, FN LED clusters
* clean up spacing
* Update README.md
* Added image and pinout
* PCB image
Diffstat (limited to 'keyboard/gh60_rev_c/keymaps')
-rw-r--r-- | keyboard/gh60_rev_c/keymaps/default.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/keyboard/gh60_rev_c/keymaps/default.c b/keyboard/gh60_rev_c/keymaps/default.c new file mode 100644 index 0000000000..3622be41b8 --- /dev/null +++ b/keyboard/gh60_rev_c/keymaps/default.c @@ -0,0 +1,69 @@ +#include "gh60.h" +#include "action_layer.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty */ + KEYMAP( + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, GRV, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSPC, \ + CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NO, ENT, \ + LSFT,FN1, Z, X, C, V, B, N, M, COMM,DOT, SLSH,FN0, RSFT, \ + LCTL,LGUI,LALT, SPC, BSLS,RALT,RGUI,APP, RCTL), + /* 1: fn */ + KEYMAP( + ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \ + TRNS,TRNS,UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS), + /* 2: arrows */ + KEYMAP( + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \ + TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,UP, \ + TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,LEFT,DOWN,RGHT), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay + [1] = ACTION_LAYER_TOGGLE(2), // toggle arrow overlay +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +void matrix_scan_user(void) { + +//Layer LED indicators + uint32_t layer = layer_state; + + if (layer & (1<<1)) { + gh60_wasd_leds_on(); + gh60_fn_led_on(); + } else { + gh60_wasd_leds_off(); + gh60_fn_led_off(); + } + + if (layer & (1<<2)) { + gh60_poker_leds_on(); + gh60_esc_led_on(); + } else { + gh60_poker_leds_off(); + gh60_esc_led_off(); + } + +}; |