summaryrefslogtreecommitdiffstats
path: root/keyboards/handwired/jotanck/keymaps
diff options
context:
space:
mode:
authorjotix <47826561+jotix@users.noreply.github.com>2019-07-20 17:25:20 -0300
committerDrashna Jaelre <drashna@live.com>2019-07-20 13:25:20 -0700
commitc6442998208a3e06695ac670ad0786100aee7040 (patch)
tree65bdd94569b967987f69a0802ccc14d850a58d21 /keyboards/handwired/jotanck/keymaps
parenta2e91ebec910d31a9f32cc56924ef3d6f0291e72 (diff)
[Keyboard] leds in default keymap (#6357)
Diffstat (limited to 'keyboards/handwired/jotanck/keymaps')
-rw-r--r--keyboards/handwired/jotanck/keymaps/default/keymap.c52
1 files changed, 41 insertions, 11 deletions
diff --git a/keyboards/handwired/jotanck/keymaps/default/keymap.c b/keyboards/handwired/jotanck/keymaps/default/keymap.c
index 3eb01a6581..44f993db60 100644
--- a/keyboards/handwired/jotanck/keymaps/default/keymap.c
+++ b/keyboards/handwired/jotanck/keymaps/default/keymap.c
@@ -13,11 +13,14 @@ extern keymap_config_t keymap_config;
#define _QWERTY 0
#define _LOWER 1
#define _RAISE 2
-#define _ADJUST 3
#define LOWER MO(_LOWER)
#define RAISE MO(_RAISE)
+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
@@ -73,20 +76,47 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END
),
-
-/* Adjust */
-[_ADJUST] = LAYOUT_ortho_4x12 (
- _______, RESET, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______,
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
- _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
-),
+
};
uint32_t layer_state_set_user(uint32_t state) {
- return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
+ #ifdef JOTANCK_LEDS
+ switch (biton32(state)) {
+ case _LOWER:
+ writePinHigh(JOTANCK_LED1);
+ writePinLow(JOTANCK_LED2);
+ break;
+ case _RAISE:
+ writePinLow(JOTANCK_LED1);
+ writePinHigh(JOTANCK_LED2);
+ break;
+ default:
+ writePinLow(JOTANCK_LED1);
+ writePinLow(JOTANCK_LED2);
+ break;
+ };
+ #endif
+ return state;
+}
+
+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_init_user(void) {
+void matrix_scan_user(void) {
+ if (is_ctl_pressed && is_esc_pressed && is_bspc_pressed) {
+ reset_keyboard();
+ }
}