From b05bb3cf7a5bcba1a662256a4e68eb57c095b5c4 Mon Sep 17 00:00:00 2001 From: Takeshi Nishio Date: Sun, 23 Aug 2020 09:51:52 +0900 Subject: [PATCH] =?UTF-8?q?Update=20ESC=E3=81=AB=E3=82=88=E3=82=8BNum?= =?UTF-8?q?=E3=83=AC=E3=82=A4=E3=83=A4=E3=83=BC=E3=83=88=E3=82=B0=E3=83=AB?= =?UTF-8?q?=E3=82=92=E3=80=81ESC=E9=80=A3=E6=89=93=E3=81=A7=E3=83=88?= =?UTF-8?q?=E3=82=B0=E3=83=AB=E3=81=99=E3=82=8B=E3=81=AE=E3=82=92=E9=98=B2?= =?UTF-8?q?=E6=AD=A2=E3=81=99=E3=82=8B=E3=81=9F=E3=82=81=E3=80=81=E3=83=80?= =?UTF-8?q?=E3=83=96=E3=83=AB=E3=82=BF=E3=83=83=E3=83=97=E3=81=8B=E3=82=89?= =?UTF-8?q?=E3=83=88=E3=83=AA=E3=83=97=E3=83=AB=E3=82=BF=E3=83=83=E3=83=97?= =?UTF-8?q?=E3=81=B8=E5=A4=89=E6=9B=B4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- keyboards/jones/v.0.2/keymaps/default/keymap.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/keyboards/jones/v.0.2/keymaps/default/keymap.c b/keyboards/jones/v.0.2/keymaps/default/keymap.c index e34ee3cacea..7940b44857c 100644 --- a/keyboards/jones/v.0.2/keymaps/default/keymap.c +++ b/keyboards/jones/v.0.2/keymaps/default/keymap.c @@ -62,7 +62,7 @@ enum tap_dances{ enum { SINGLE_TAP = 1, SINGLE_HOLD, - DOUBLE_TAP + TRIPLE_TAP }; // Declare the functions to be used with your tap dance key(s) @@ -416,7 +416,8 @@ void encoder_update_user(uint8_t index, bool clockwise) { // ESCキーの動作を、次のようにする設定 // シングルタップ:ESC // シングルタップしてホールド:NUMレイヤー -// ダブルタップ:Numレイヤーをトグル +// トリプルタップ:Numレイヤーをトグル +// NOTE:ESCを連打(=タブルタップ)して、Numレイヤーになるのを防止するためトリプルに。 typedef struct { bool is_press_action; @@ -425,10 +426,10 @@ typedef struct { // Determine the current tap dance state uint8_t cur_dance(qk_tap_dance_state_t *state) { - if (state->count == 1) { + if (state->count < 3) { if (!state->pressed) return SINGLE_TAP; else return SINGLE_HOLD; - } else if (state->count == 2) return DOUBLE_TAP; + } else if (state->count == 3) return TRIPLE_TAP; else return 8; } @@ -448,7 +449,7 @@ void ql_finished(qk_tap_dance_state_t *state, void *user_data) { case SINGLE_HOLD: layer_on(_NUM); break; - case DOUBLE_TAP: + case TRIPLE_TAP: // Check to see if the layer is already set if (layer_state_is(_NUM)) { // If already set, then switch it off