summaryrefslogtreecommitdiff
path: root/keyboards/dz60/keymaps/iso_split-spacebar/keymap.c
diff options
context:
space:
mode:
authormcarni <michele.carnaghi@googlemail.com>2020-06-13 09:29:22 +0200
committerGitHub <noreply@github.com>2020-06-13 00:29:22 -0700
commit1f42071238c57aff1ec2d441fe82ae2df4a0853f (patch)
tree9850d0eccd27f5fd39d9cbc78cdfae595daf241b /keyboards/dz60/keymaps/iso_split-spacebar/keymap.c
parent400423d10b53ea9e309e7b014aa4685961f25a4f (diff)
dz60 iso split - cleaned up the readme and replaced normal key with numpad key on numpad layer (#9339)
* README cleanup * replaced "normal" numbers with "keypad" numbers: KC_P4 replaced by KC_KP_P4 * replaced "normal" keys on Numpad Layer with the "KeyPad" keys KC_1 replaced by KC_P1 etc.
Diffstat (limited to 'keyboards/dz60/keymaps/iso_split-spacebar/keymap.c')
-rw-r--r--keyboards/dz60/keymaps/iso_split-spacebar/keymap.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/keyboards/dz60/keymaps/iso_split-spacebar/keymap.c b/keyboards/dz60/keymaps/iso_split-spacebar/keymap.c
index a54c06f557..a9e811f9a4 100644
--- a/keyboards/dz60/keymaps/iso_split-spacebar/keymap.c
+++ b/keyboards/dz60/keymaps/iso_split-spacebar/keymap.c
@@ -112,12 +112,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-----------------------------------------------------------'
*/
[NL] = LAYOUT_60_iso_split(
- // 1 2 3 4 5 6 7 8 9 10 11 12 13 14
- TG(NL), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______,
- _______, KC_4, KC_5, KC_6, KC_PAST, KC_PSLS, _______, KC_4, KC_5, KC_6, KC_PAST, KC_PSLS, _______,
- _______, KC_7, KC_8, KC_9, KC_PPLS, KC_PMNS, _______, KC_1, KC_2, KC_3, KC_PPLS, KC_PMNS, _______, _______,
- _______, KC_0, KC_COMM, KC_DOT, KC_EQL, _______, _______, _______, KC_0, KC_COMM, KC_DOT, KC_EQL, _______,
- _______, _______, _______, _______, MO(FL), _______, _______, _______, TG(RL), _______),
+ // 1 2 3 4 5 6 7 8 9 10 11 12 13 14
+ TG(NL), KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_PPLS, KC_PMNS, _______,
+ _______, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PSLS, _______, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PSLS, _______,
+ _______, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_PMNS, _______, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PMNS, _______, _______,
+ _______, KC_P0, KC_COMM, KC_DOT, KC_PEQL, KC_PSLS, KC_PMNS, _______, KC_P0, KC_COMM, KC_DOT, KC_PEQL, _______,
+ _______, _______, _______, _______, MO(FL), _______, _______, _______, TG(RL), _______),
/* Keymap RL: RGB Layer
*
@@ -150,6 +150,23 @@ void persistent_default_layer_set(uint16_t default_layer) {
default_layer_set(default_layer);
}
+// always enable num lock on layer NL and disable on other layers
+// thanks to spidey3 & Erovia on discord
+layer_state_t layer_state_set_user(layer_state_t state) {
+ switch (get_highest_layer(state)) {
+ case NL:
+ if (!host_keyboard_led_state().num_lock) {
+ tap_code16(KC_NLCK);
+ }
+ break;
+ default: // for any other layers, or the default layer
+ if (host_keyboard_led_state().num_lock) {
+ tap_code16(KC_NLCK);
+ }
+ break;
+ }
+ return state;
+}
// layer-activated RGB underglow
@@ -172,11 +189,11 @@ void matrix_scan_user(void) {
break;
case NL:
RGB_NL_MODE;
- // RGB_NL_LIGHT;
+ RGB_NL_LIGHT;
break;
case RL:
RGB_RL_MODE;
- // RGB_RL_LIGHT;
+ RGB_RL_LIGHT;
break;
}