summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjotix <47826561+jotix@users.noreply.github.com>2020-06-24 20:27:25 -0300
committerGitHub <noreply@github.com>2020-06-25 09:27:25 +1000
commit2521b970e5494380ccbdda922ea3f521e76ad01c (patch)
tree02574940fe5112297577cfdb1c61bd7ff54b9d3f
parent598c392709141a8d9bff1d8ab12fd50ef4f478ae (diff)
downloadqmk_firmware-2521b970e5494380ccbdda922ea3f521e76ad01c.tar.gz
qmk_firmware-2521b970e5494380ccbdda922ea3f521e76ad01c.zip
add_adjust_layer (#9532)
-rw-r--r--layouts/community/ortho_4x12/jotix/keymap.c44
1 files changed, 15 insertions, 29 deletions
diff --git a/layouts/community/ortho_4x12/jotix/keymap.c b/layouts/community/ortho_4x12/jotix/keymap.c
index 09543090d2..d28be78e56 100644
--- a/layouts/community/ortho_4x12/jotix/keymap.c
+++ b/layouts/community/ortho_4x12/jotix/keymap.c
@@ -4,16 +4,13 @@ enum layers {
_QWERTY,
_LOWER,
_RAISE,
+ _ADJUST
};
#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
#define TGLOWER TG(_LOWER)
-static bool is_ctl_pressed;
-static bool is_esc_pressed;
-static bool is_bspc_pressed;
-
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_ortho_4x12 (
@@ -52,46 +49,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
),
+[_ADJUST] = LAYOUT_ortho_4x12 (
+// ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐
+ _______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
+// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
+ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
+// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
+ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
+// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
+ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______
+// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
+),
+
};
layer_state_t layer_state_set_user(layer_state_t state) {
#ifdef JOTANCK_LEDS
writePin(JOTANCK_LED1, (get_highest_layer(state) == _LOWER));
#endif
- return state;
+ return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
bool led_update_user(led_t led_state) {
-
// NumLock allways on
if (!led_state.num_lock) {
tap_code(KC_NUMLOCK);
}
-
#ifdef JOTANCK_LEDS
// CapsLock led
writePin(JOTANCK_LED2, led_state.caps_lock);
#endif
return true;
-}
-
-bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- switch (keycode) {
- case KC_LCTL:
- is_ctl_pressed = record->event.pressed;
- break;
- case KC_ESC:
- is_esc_pressed = record->event.pressed;
- break;
- case KC_BSPC:
- is_bspc_pressed = record->event.pressed;
- break;
- };
- return true;
-}
-
-void matrix_scan_user(void) {
- if (is_ctl_pressed && is_esc_pressed && is_bspc_pressed) {
- reset_keyboard();
- }
-}
+} \ No newline at end of file