aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2019-05-21 13:40:50 -0700
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-05-21 13:40:50 -0700
commiteb756916c2b1d3b03b1aa26b8bb02e91ce849089 (patch)
treef271f762a4cefd915603a4eb67255e8edde20a7a
parentfc3965ef70ead4d01209c344f9a5f8e1dcf8a1dd (diff)
downloadqmk_firmware-eb756916c2b1d3b03b1aa26b8bb02e91ce849089.tar.gz
qmk_firmware-eb756916c2b1d3b03b1aa26b8bb02e91ce849089.zip
[Keyboard] Fix 9key macropad keymap (#5942)
Fails to compile on the configurator because tapdance is enabled for the entire keyboard
-rw-r--r--keyboards/9key/keymaps/default/keymap.c38
-rw-r--r--keyboards/9key/keymaps/default/rules.mk0
-rw-r--r--keyboards/9key/keymaps/tap_dance/keymap.c69
-rw-r--r--keyboards/9key/keymaps/tap_dance/rules.mk1
-rw-r--r--keyboards/9key/rules.mk4
5 files changed, 76 insertions, 36 deletions
diff --git a/keyboards/9key/keymaps/default/keymap.c b/keyboards/9key/keymaps/default/keymap.c
index 9f6397169..acc035073 100644
--- a/keyboards/9key/keymaps/default/keymap.c
+++ b/keyboards/9key/keymaps/default/keymap.c
@@ -1,16 +1,5 @@
1#include QMK_KEYBOARD_H 1#include QMK_KEYBOARD_H
2 2
3// Tap Dance Declarations
4enum {
5 ENT_5 = 0,
6 ZERO_7
7};
8
9// Macro Declarations
10enum {
11 DBL_0 = 0
12};
13
14const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
15 4
16/* LAYER 0 5/* LAYER 0
@@ -24,8 +13,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
24 */ 13 */
25[0] = LAYOUT( \ 14[0] = LAYOUT( \
26 KC_1, KC_2, KC_3, \ 15 KC_1, KC_2, KC_3, \
27 KC_4, TD(ENT_5), KC_6, \ 16 KC_4, KC_5, KC_6, \
28 TD(ZERO_7), KC_8, LT(1, KC_9) \ 17 KC_7, KC_8, LT(1, KC_9) \
29), 18),
30 19
31/* LAYER 1 20/* LAYER 1
@@ -39,27 +28,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
39 */ 28 */
40[1] = LAYOUT( \ 29[1] = LAYOUT( \
41 KC_ESC, KC_PLUS, KC_MINS, \ 30 KC_ESC, KC_PLUS, KC_MINS, \
42 KC_BSPC, KC_ASTR, KC_SLSH, \ 31 KC_ENTER, KC_ASTR, KC_SLSH, \
43 M(DBL_0), KC_DOT, KC_TRNS \ 32 KC_0, KC_DOT, KC_TRNS \
44) 33)
45 34
46}; 35};
47
48qk_tap_dance_action_t tap_dance_actions[] = {
49 [ENT_5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT),
50 [ZERO_7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_0)
51};
52
53const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
54 if (record->event.pressed) {
55 switch(id) {
56 case DBL_0:
57 SEND_STRING("00");
58 return false;
59 }
60 }
61 return MACRO_NONE;
62};
63
64void matrix_init_user(void) {
65} \ No newline at end of file
diff --git a/keyboards/9key/keymaps/default/rules.mk b/keyboards/9key/keymaps/default/rules.mk
deleted file mode 100644
index e69de29bb..000000000
--- a/keyboards/9key/keymaps/default/rules.mk
+++ /dev/null
diff --git a/keyboards/9key/keymaps/tap_dance/keymap.c b/keyboards/9key/keymaps/tap_dance/keymap.c
new file mode 100644
index 000000000..a96880aa5
--- /dev/null
+++ b/keyboards/9key/keymaps/tap_dance/keymap.c
@@ -0,0 +1,69 @@
1#include QMK_KEYBOARD_H
2
3// Tap Dance Declarations
4enum tap_dances {
5 ENT_5 = 0,
6 ZERO_7,
7};
8
9// Macro Declarations
10enum custom_keycodes {
11 DBL_0 = SAFE_RANGE,
12};
13
14const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
15
16/* LAYER 0
17 * ,-----------------------.
18 * | 1 | 2 | 3 |
19 * |-------+-------+-------|
20 * | 4 | 5/ENT | 6 | Dbl Tap 5 for Enter
21 * |-------+-------+-------|
22 * | 7/0 | 8 | 9/FN | 7/0 = Dbl Tap 7 for 0 - 9/FN = Hold 9 for FN
23 * `-----------------------'
24 */
25[0] = LAYOUT( \
26 KC_1, KC_2, KC_3, \
27 KC_4, TD(ENT_5), KC_6, \
28 TD(ZERO_7), KC_8, LT(1, KC_9) \
29),
30
31/* LAYER 1
32 * ,-----------------------.
33 * | ESC | + | - |
34 * |-------+-------+-------|
35 * | BSPC | * | / |
36 * |-------+-------+-------|
37 * | 00 | . | |
38 * `-----------------------'
39 */
40[1] = LAYOUT( \
41 KC_ESC, KC_PLUS, KC_MINS, \
42 KC_BSPC, KC_ASTR, KC_SLSH, \
43 DBL_0, KC_DOT, KC_TRNS \
44)
45
46};
47
48qk_tap_dance_action_t tap_dance_actions[] = {
49 [ENT_5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_ENT),
50 [ZERO_7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_0)
51};
52
53bool process_record_user(uint16_t keycode, keyrecord_t *record) {
54 switch (keycode) {
55 case DBL_0:
56 if (record->event.pressed) {
57 // when keycode QMKBEST is pressed
58 tap_code(KC_P0);
59 tap_code(KC_P0);
60 }
61 break;
62
63 }
64 return true;
65};
66
67
68void matrix_init_user(void) {
69}
diff --git a/keyboards/9key/keymaps/tap_dance/rules.mk b/keyboards/9key/keymaps/tap_dance/rules.mk
new file mode 100644
index 000000000..e5ddcae8d
--- /dev/null
+++ b/keyboards/9key/keymaps/tap_dance/rules.mk
@@ -0,0 +1 @@
TAP_DANCE_ENABLE = yes
diff --git a/keyboards/9key/rules.mk b/keyboards/9key/rules.mk
index e252640f7..9fae54fa9 100644
--- a/keyboards/9key/rules.mk
+++ b/keyboards/9key/rules.mk
@@ -47,7 +47,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
47OPT_DEFS += -DBOOTLOADER_SIZE=4096 47OPT_DEFS += -DBOOTLOADER_SIZE=4096
48 48
49# Build Options 49# Build Options
50# change to "no" to disable the options, or define them in the Makefile in 50# change to "no" to disable the options, or define them in the Makefile in
51# the appropriate keymap folder that will get included automatically 51# the appropriate keymap folder that will get included automatically
52# 52#
53BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) 53BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
@@ -63,7 +63,7 @@ UNICODE_ENABLE = yes # Unicode
63BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID 63BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
64RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. 64RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
65API_SYSEX_ENABLE = yes 65API_SYSEX_ENABLE = yes
66TAP_DANCE_ENABLE = yes 66TAP_DANCE_ENABLE = no
67 67
68# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE 68# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
69SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend 69SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend