aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/puck/keymaps/default
diff options
context:
space:
mode:
authorGravatar John Pettigrew <john.pettigrew404@gmail.com>2018-11-27 15:43:48 -0600
committerGravatar MechMerlin <30334081+mechmerlin@users.noreply.github.com>2018-11-27 13:43:48 -0800
commitd79b5e67b691e367897a24008ec3f2188b1642f3 (patch)
treecdd14b79c3469cd83034c91f1898d43a5e49f1f1 /keyboards/puck/keymaps/default
parent90f9fb4eee0da25e5408e54ed872c6da2a40c5f3 (diff)
downloadqmk_firmware-d79b5e67b691e367897a24008ec3f2188b1642f3.tar.gz
Puck Macropad (#4274)
* Add Puck * Update Manufacturer name in metadata * Add num lock to high layer * update pins * update pin settings * fix numlock key * Cleanup config.h * Update device info * updates after review
Diffstat (limited to 'keyboards/puck/keymaps/default')
-rw-r--r--keyboards/puck/keymaps/default/keymap.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/keyboards/puck/keymaps/default/keymap.c b/keyboards/puck/keymaps/default/keymap.c
new file mode 100644
index 000000000..6ba70a88b
--- /dev/null
+++ b/keyboards/puck/keymaps/default/keymap.c
@@ -0,0 +1,64 @@
+#include QMK_KEYBOARD_H
+
+#define _BL 0
+#define _HL 1
+#define _LL 2
+
+enum keycodes {
+ LOW,
+ HIGH
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ /*
+ * Base Layer (Numbers)
+ */
+ [_BL] = LAYOUT(
+ KC_KP_7, KC_KP_8, KC_KP_9,
+ KC_KP_4, KC_KP_5, KC_KP_6,
+ KC_KP_1, KC_KP_2, KC_KP_3,
+ LOW, KC_KP_0, HIGH
+ ),
+ /*
+ * High Layer (Work)
+ */
+ [_HL] = LAYOUT(
+ KC_NUMLOCK, KC_PAST, KC_NO,
+ KC_PMNS, KC_PENT, KC_PPLS,
+ KC_NO, KC_PSLS, KC_NO,
+ KC_NO, KC_PDOT, KC_NO
+ ),
+ /*
+ * Low Layer (Media)
+ */
+ [_LL] = LAYOUT(
+ KC_NO, KC_VOLU, KC_NO,
+ KC_MPRV, KC_MPLY, KC_MNXT,
+ KC_NO, KC_VOLD, KC_NO,
+ KC_NO, KC_NO, KC_NO
+ ),
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch(keycode) {
+ case HIGH:
+ if (record->event.pressed) {
+ layer_on(_HL);
+ }else{
+ layer_off(_HL);
+ layer_off(_LL);
+ }
+ return false;
+ break;
+ case LOW:
+ if (record->event.pressed) {
+ layer_on(_LL);
+ }else{
+ layer_off(_LL);
+ layer_off(_HL);
+ }
+ return false;
+ break;
+ }
+ return true;
+}