summaryrefslogtreecommitdiff
path: root/keyboards/handwired/2x5keypad/keymaps/default/keymap.c
diff options
context:
space:
mode:
authorJonathan Cameron <jmcameron@gmail.com>2019-09-09 22:03:33 -0700
committerDrashna Jaelre <drashna@live.com>2019-09-09 22:03:33 -0700
commit2e521b509ce0c853b2e62d1d16e0117b900ab9c2 (patch)
treec795ea9e11322edaebdd7cde506fb6014cebb8cf /keyboards/handwired/2x5keypad/keymaps/default/keymap.c
parent00225b77e54fdc893f6c64768e1bffaa01df5849 (diff)
[Keyboard] Added a simple 2x5 Keypad with 4 layers (#6699)
* Added new 2x5 Keypad with 3 LEDs to indicate the selected layer. By Jonathan Cameron. * Minor refactor from suggestions from qmk team * Added * Moved to 'handwired' directory * Update readme.md * Update readme.md * Update readme.md * Update keyboards/handwired/2x5keypad/readme.md Co-Authored-By: fauxpark <fauxpark@gmail.com> * Switch to image offsite * Moved image offsite * Update keyboards/handwired/2x5keypad/keymaps/default/keymap.h Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update keyboards/handwired/2x5keypad/2x5keypad.h Co-Authored-By: fauxpark <fauxpark@gmail.com> * Moved functions into .c file per suggestions * Cosmetic * Fixed function called, per suggestions. * Update keyboards/handwired/2x5keypad/2x5keypad.h Ok Co-Authored-By: fauxpark <fauxpark@gmail.com> * Moved LED functions to the top level since they can be used it various flavors * Declare those moved LED functions! * Update keyboards/handwired/2x5keypad/config.h Co-Authored-By: Drashna Jaelre <drashna@live.com>
Diffstat (limited to 'keyboards/handwired/2x5keypad/keymaps/default/keymap.c')
-rw-r--r--keyboards/handwired/2x5keypad/keymaps/default/keymap.c69
1 files changed, 69 insertions, 0 deletions
diff --git a/keyboards/handwired/2x5keypad/keymaps/default/keymap.c b/keyboards/handwired/2x5keypad/keymaps/default/keymap.c
new file mode 100644
index 0000000000..808824f3a2
--- /dev/null
+++ b/keyboards/handwired/2x5keypad/keymaps/default/keymap.c
@@ -0,0 +1,69 @@
+#include QMK_KEYBOARD_H
+
+#define WIN_TAB LGUI(KC_TAB)
+#define WIN_LOCK LGUI(KC_L)
+
+enum layers {
+ NORMAL_LAYER = 0,
+ MEDIA_LAYER,
+ TBD_LAYER2,
+ TBD_LAYER3
+};
+
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [NORMAL_LAYER]=
+ LAYOUT(TO(1), WIN_TAB, KC_HOME, KC_UP, KC_END,
+ WIN_LOCK, KC_MUTE, KC_LEFT, KC_DOWN, KC_RGHT),
+
+ [MEDIA_LAYER]=
+ LAYOUT(TO(2), KC_CALC, KC_MPRV, KC_MNXT, KC_VOLU,
+ KC_TRNS, KC_TRNS, KC_MSTP, KC_MPLY, KC_VOLD),
+
+ [TBD_LAYER2]=
+ LAYOUT(TO(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
+
+ [TBD_LAYER3]=
+ LAYOUT(TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
+};
+
+
+/* DISABLED
+void matrix_init_user(void) {
+}
+
+void matrix_scan_user(void) {
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ return true;
+}
+*/
+
+
+layer_state_t layer_state_set_user(layer_state_t state)
+{
+ turn_off_leds();
+
+ switch (biton32(state))
+ {
+ case NORMAL_LAYER:
+ break;
+
+ case MEDIA_LAYER:
+ turn_on_led(RED_LED);
+ break;
+
+ case TBD_LAYER2:
+ turn_on_led(BLUE_LED);
+ break;
+
+ case TBD_LAYER3:
+ turn_on_led(GREEN_LED);
+ break;
+ }
+ return state;
+}