From 9d915ed051c43edd828d6cdb784a5d094e9b312d Mon Sep 17 00:00:00 2001 From: epaew Date: Sun, 10 Mar 2019 01:22:21 +0900 Subject: [PATCH] Update edvorak keymap simplify (#5350) * Update edvorakjp layouts * swap master hand * update tapping_term --- keyboards/crkbd/keymaps/edvorakjp/config.h | 7 +- keyboards/crkbd/keymaps/edvorakjp/keymap.c | 140 ++++--------- keyboards/crkbd/keymaps/edvorakjp/oled.c | 18 +- .../helix/rev2/keymaps/edvorakjp/config.h | 18 +- .../helix/rev2/keymaps/edvorakjp/keymap.c | 27 +-- .../rev2/keymaps/edvorakjp/keymap_4rows.c | 102 +++------- .../rev2/keymaps/edvorakjp/keymap_5rows.c | 122 ++++-------- .../rev2/keymaps/edvorakjp/keymap_xrows.h | 31 ++- keyboards/helix/rev2/keymaps/edvorakjp/oled.c | 14 +- .../helix/rev2/keymaps/edvorakjp/rules.mk | 1 + .../keebio/iris/keymaps/edvorakjp/config.h | 19 +- .../keebio/iris/keymaps/edvorakjp/keymap.c | 187 +++++------------- .../keebio/iris/keymaps/edvorakjp/rules.mk | 26 +-- users/edvorakjp/edvorakjp.c | 6 - users/edvorakjp/edvorakjp.h | 26 +-- users/edvorakjp/edvorakjp_process_record.c | 129 +----------- users/edvorakjp/edvorakjp_status.c | 13 +- users/edvorakjp/edvorakjp_tap_dance.c | 36 ++-- users/edvorakjp/readme.md | 54 +---- 19 files changed, 249 insertions(+), 727 deletions(-) diff --git a/keyboards/crkbd/keymaps/edvorakjp/config.h b/keyboards/crkbd/keymaps/edvorakjp/config.h index 515591a42..b8662aca0 100644 --- a/keyboards/crkbd/keymaps/edvorakjp/config.h +++ b/keyboards/crkbd/keymaps/edvorakjp/config.h @@ -3,15 +3,16 @@ /* Select hand configuration */ -#define MASTER_LEFT -// #define MASTER_RIGHT +// #define MASTER_LEFT +#define MASTER_RIGHT // #define EE_HANDS #define SSD1306OLED #define SWAP_SCLN // #define TAPPING_FORCE_HOLD -#define TAPPING_TERM 120 +#define TAPPING_TERM 300 +#define IGNORE_MOD_TAP_INTERRUPT #undef RGBLED_NUM #define RGBLIGHT_EFFECT_STATIC_GRADIENT diff --git a/keyboards/crkbd/keymaps/edvorakjp/keymap.c b/keyboards/crkbd/keymaps/edvorakjp/keymap.c index ae2f710a0..32001f22d 100644 --- a/keyboards/crkbd/keymaps/edvorakjp/keymap.c +++ b/keyboards/crkbd/keymaps/edvorakjp/keymap.c @@ -16,113 +16,61 @@ #define KC_ KC_TRNS -#define KC_TMB1 LGUI_T(KC_TAB) -#define KC_TMB2 LSFT_T(KC_SPC) +#define KC_TMB1 KC_LA(TAB) +#define KC_TMB2 KC_LS(SPC) #define KC_TMB3 TD(TD_LOWER) // act as LOWER when hold, as KC_LANG2(=English) when tapped #define KC_TMB4 TD(TD_RAISE) // act as RAISE when hold, as KC_LANG1(=Japanese) when tapped -#define KC_TMB5 RCTL_T(KC_BSPC) -#define KC_TMB6 RALT_T(KC_ENT) -#define KC_TMB7 KC_DEL -#define KC_TMB8 RALT(KC_ENT) -#define KC_TMB9 LGUI(KC_TAB) - -#define KC_RST RESET -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_EDJP EDVORAK -#define KC_QWER QWERTY +#define KC_TMB5 KC_RC(BSPC) +#define KC_TMB6 KC_RG(ENT) +#define KC_TMB7 KC_RC(DEL) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_EDVORAK] = LAYOUT_kc( - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ESC ,QUOT,COMM,DOT , Y , P , F , G , R , W , Q ,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - EQL , A , O , E , I , U , D , T , N , S , M ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - GRV ,SCLN, X , C , V , Z , B , H , J , K , L ,SLSH, - //`----+----+----+----+----+----+----| |----+----+----+----+----+----+----' - TMB1,TMB2,TMB3, TMB4,TMB5,TMB6 - // `----+----+----' `----+----+----' - ), - - [_EDVORAKJ1] = LAYOUT_kc( - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , AI , OU , EI , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , Y , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , - //`----+----+----+----+----+----+----| |----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_EDVORAKJ2] = LAYOUT_kc( - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , AI , OU , EI , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , Y , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , - //`----+----+----+----+----+----+----| |----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' - ), - - [_QWERTY] = LAYOUT_kc( - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - EQL , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - GRV , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,BSLS, - //`----+----+----+----+----+----+----| |----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + GRV ,QUOT,COMM , DOT , Y , Q , F , G , R , W , P ,BSLS, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + EQL , A ,LA(O),LG(E),LC(I), U , D ,RS(T),RG(N),RA(S), M ,MINS, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + ESC ,SCLN, X , C , V , Z , H , J , K , L , B ,SLSH, + //`----+----+-----+-----+-----+----+----| |----+----+-----+-----+-----+----+----' + TMB1 ,TMB2,TMB3, TMB4,TMB5,TMB6 + // `-----+----+----' `----+----+-----' ), [_LOWER] = LAYOUT_kc( - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , 1 ,EXLM, AT ,HASH,DLR , PERC,CIRC,AMPR,ASTR, 0 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , LT ,LCBR,LPRN,LBRC, RBRC,RPRN,RCBR, GT , , , - //`----+----+----+----+----+----+----| |----+----+----+----+----+----+----' - , , , ,TMB7,TMB8 - // `----+----+----' `----+----+----' + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + , , LCBR , LBRC , LPRN , , , RPRN , RBRC , RCBR , , , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + F1 , F2 ,LA(F3),LG(F4),LC(F5), F6 , F7 ,RS(F8),RG(F9),RA(F10),F11 ,F12 , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + PSCR, , HOME , PGDN , PGUP ,END , LEFT, DOWN , UP , RGHT , , , + //`----+----+------+------+------+----+----| |----+----+------+------+-------+----+----' + , , NO , MAC ,TMB7, + // `-----+----+----' `----+----+-----' ), [_RAISE] = LAYOUT_kc( - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,F11 ,F12 ,PSCR,SLCK,PAUS, ,HOME,PGDN,PGUP,END , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , ,LEFT,DOWN, UP ,RGHT, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----' - TMB9, , , , , - // `----+----+----' `----+----+----' - ), - - [_ADJUST] = LAYOUT_kc( - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , ,EXTOFF, , ,EXTON, , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , ,QWER,WIN ,RST , RTOG,MAC ,EDJP, , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //`----+----+----+----+----+----+----| |----+----+----+----+----+----+----' - , , , , , - // `----+----+----' `----+----+----' + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + , ,EXLM , AT ,HASH ,DLR , PERC,CIRC ,AMPR ,ASTR , , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + , 1 ,LA(2),LG(3),LC(4), 5 , 6 ,RS(7),RG(8),RA(9), 0 , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + PSCR, ,HOME ,PGDN ,PGUP ,END , LEFT,DOWN , UP ,RGHT , , , + //`----+----+-----+-----+-----+----+----| |----+----+-----+-----+-----+----+----' + , ,WIN , NO , , + // `-----+----+----' `----+----+----' ) }; #ifdef SSD1306OLED void matrix_init_keymap(void) { //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - iota_gfx_init(!has_usb()); // turns on the display +#ifdef MASTER_RIGHT + iota_gfx_init(has_usb()); // turns on the display +#else + iota_gfx_init(!has_usb()); +#endif // MASTER_RIGHT } void matrix_scan_user(void) { @@ -134,23 +82,15 @@ void matrix_scan_user(void) { uint32_t layer_state_set_keymap(uint32_t state) { rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); switch (biton32(state)) { - case _EDVORAKJ1: - case _EDVORAKJ2: - // _EDVORAKJ1 & J2 are same colored - rgblight_sethsv_noeeprom_white(); - break; case _LOWER: rgblight_sethsv_noeeprom_red(); break; case _RAISE: - rgblight_sethsv_noeeprom_blue(); - break; - case _ADJUST: rgblight_sethsv_noeeprom_green(); break; - default: // for any other layers, or the default layer - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 3); - rgblight_sethsv_noeeprom_red(); + default: // for any other layers, or the default layer + rgblight_mode(RGBLIGHT_MODE_STATIC_GRADIENT + 3); + rgblight_sethsv_red(); break; } return state; diff --git a/keyboards/crkbd/keymaps/edvorakjp/oled.c b/keyboards/crkbd/keymaps/edvorakjp/oled.c index e4cccf3e7..cbb43d061 100644 --- a/keyboards/crkbd/keymaps/edvorakjp/oled.c +++ b/keyboards/crkbd/keymaps/edvorakjp/oled.c @@ -21,11 +21,7 @@ const char *read_layer_state(void) { switch (biton32(layer_state)) { case L_BASE: - strcpy(layer_name, default_layer_state == 1UL<<_EDVORAK ? "EDVORAK" : "QWERTY"); - break; - case _EDVORAKJ1: - case _EDVORAKJ2: - strcpy(layer_name, "JP_EXT"); + strcpy(layer_name, "Default"); break; case _RAISE: strcpy(layer_name, "Raise"); @@ -33,9 +29,6 @@ const char *read_layer_state(void) { case _LOWER: strcpy(layer_name, "Lower"); break; - case _ADJUST: - strcpy(layer_name, "Adjust"); - break; default: snprintf(layer_name, sizeof(layer_name), "Undef-%ld", layer_state); } @@ -49,10 +42,7 @@ const char *read_layer_state(void) { const char *read_host_led_state(void) { static char led_str[24]; - bool ext_status = get_enable_jp_extra_layer() && get_japanese_mode(); - strcpy(led_str, ext_status ? "EXT" : " "); - - strcat(led_str, (host_keyboard_leds() & (1<event.pressed) { - if (get_enable_kc_lang()) { - SEND_STRING( SS_LCTRL(SS_LSFT(SS_TAP(X_POWER))) ); - } else { - SEND_STRING( SS_LGUI("l") ); - } - } - return false; - } - return true; -} - #ifdef SSD1306OLED void matrix_init_keymap(void) { //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h @@ -37,23 +22,15 @@ void matrix_scan_user(void) { uint32_t layer_state_set_keymap(uint32_t state) { rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); switch (biton32(state)) { - case _EDVORAKJ1: - case _EDVORAKJ2: - // _EDVORAKJ1 & J2 are same colored - rgblight_sethsv_noeeprom_white(); - break; case _LOWER: rgblight_sethsv_noeeprom_red(); break; case _RAISE: rgblight_sethsv_noeeprom_blue(); break; - case _ADJUST: - rgblight_sethsv_noeeprom_green(); - break; default: // for any other layers, or the default layer - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 3); - rgblight_sethsv_noeeprom_red(); + rgblight_mode(RGBLIGHT_MODE_STATIC_GRADIENT + 3); + rgblight_sethsv_red(); break; } return state; diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_4rows.c b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_4rows.c index 805e6b17b..f2befc03b 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_4rows.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_4rows.c @@ -4,86 +4,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_EDVORAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - LBRC,RBRC,COMM,DOT , Y , P , F , G , R , W , Q ,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - EQL , A , O , E , I , U , D , T , N , S , M ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - QUOT,SCLN, X , C , V , Z , B , H , J , K , L ,SLSH, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LEFT,DOWN, UP ,RGHT,TMB1,TMB2,TMB3, TMB6,TMB7,TMB8,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_EDVORAKJ1] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , AI , OU , EI , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , Y , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_EDVORAKJ2] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , AI , OU , EI , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , Y , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - EQL , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LBRC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - RBRC, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,BSLS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + //,----+----+-----+-----+-----+----. ,----+-----+-----+-----+----+----. + GRV ,QUOT,COMM , DOT , Y , Q , F , G , R , W , P ,BSLS, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + EQL , A ,LA(O),LG(E),LC(I), U , D ,RS(T),RG(N),RA(S), M ,MINS, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + ESC ,SCLN, X , C , V , Z , H , J , K , L , B ,SLSH, + //|----+----+-----+-----+-----+----+----. ,----+----+-----+-----+-----+----+----| + HOME,PGDN,PGUP , END ,TMB1 ,TMB2,TMB3, TMB4,TMB5,TMB6 ,LEFT ,DOWN , UP ,RGHT + //`----+----+-----+-----+-----+----+----/ \----+----+-----+-----+-----+----+----' ), [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F1 , F2 , F3 , F4 , F5 ,LCBR, RCBR, 7 , 8 , 9 ,MINS,SLSH, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F6 , F7 , F8 , F9 ,F10 ,LPRN, RPRN, 4 , 5 , 6 ,PLUS,ASTR, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F11 ,F12 ,PSCR,SLCK,PAUS,LBRC, RBRC, 1 , 2 , 3 , NO , NO , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - HOME,PGDN,PGUP,END , , , , ,ESC , 0 ,HOME,PGDN,PGUP,END - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + //,----+----+------+------+------+----. ,----+------+------+-------+----+----. + , , LCBR , LBRC , LPRN , , , RPRN , RBRC , RCBR , , , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + F1 , F2 ,LA(F3),LG(F4),LC(F5), F6 , F7 ,RS(F8),RG(F9),RA(F10),F11 ,F12 , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + PSCR, , HOME , PGDN , PGUP ,END , LEFT, DOWN , UP , RGHT , , , + //|----+----+------+------+------+----+----. ,----+----+------+------+-------+----+----| + , , , , , , NO , MAC ,TMB7, , , , , + //`----+----+------+------+------+----+----/ \----+----+------+------+-------+----+----' ), [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, NO , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , NO , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - HOME,PGDN,PGUP,END ,TMB9,ESC , , , , ,HOME,PGDN,PGUP,END - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_ADJUST] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , ,EXTOFF, , ,EXTON, , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,RST ,DBUG,RTOG,WIN , , ,MAC ,QWER,EDJP, , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + //,----+----+-----+-----+-----+----. ,----+-----+-----+-----+----+----. + , ,EXLM , AT ,HASH ,DLR , PERC,CIRC ,AMPR ,ASTR , , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + , 1 ,LA(2),LG(3),LC(4), 5 , 6 ,RS(7),RG(8),RA(9), 0 , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + PSCR, ,HOME ,PGDN ,PGUP ,END , LEFT,DOWN , UP ,RGHT , , , + //|----+----+-----+-----+-----+----+----. ,----+----+-----+-----+-----+----+----| + , , , , , ,WIN , NO , , , , , , + //`----+----+-----+-----+-----+----+----/ \----+----+-----+-----+-----+----+----' ) }; diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_5rows.c b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_5rows.c index ef1b9d358..642ba8c63 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_5rows.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_5rows.c @@ -4,100 +4,44 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_EDVORAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - GRV ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LBRC,RBRC,COMM,DOT , Y , P , F , G , R , W , Q ,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - EQL , A , O , E , I , U , D , T , N , S , M ,MINS, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - QUOT,SCLN, X , C , V , Z ,TMB4, TMB5, B , H , J , K , L ,SLSH, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - LEFT,DOWN, UP ,RGHT,TMB1,TMB2,TMB3, TMB6,TMB7,TMB8,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_EDVORAKJ1] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , AI , OU , EI , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , Y , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_EDVORAKJ2] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , AI , OU , EI , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , Y , , , , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_QWERTY] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - GRV ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - EQL , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LBRC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - RBRC, Z , X , C , V , B , , , N , M ,COMM,DOT ,SLSH,BSLS, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + //,----+----+-----+-----+-----+----. ,----+-----+-----+-----+----+----. + ESC ,EXLM, AT ,HASH , DLR ,PERC, CIRC,AMPR ,ASTR ,LPRN ,RPRN,BSPC, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + GRV ,QUOT,COMM , DOT , Y , Q , F , G , R , W , P ,BSLS, + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + EQL , A ,LA(O),LG(E),LC(I), U , D ,RS(T),RG(N),RA(S), M ,MINS, + //|----+----+-----+-----+-----+----+----. ,----+----+-----+-----+-----+----+----| + TAB ,SCLN, X , C , V , Z , NO , NO , H , J , K , L , B ,SLSH, + //|----+----+-----+-----+-----+----+----| |----+----+-----+-----+-----+----+----| + HOME,PGDN,PGUP , END ,TMB1 ,TMB2,TMB3, TMB4,TMB5,TMB6 ,LEFT ,DOWN , UP ,RGHT + //`----+----+-----+-----+-----+----+----/ \----+----+-----+-----+-----+----+----' ), [_LOWER] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , ,SLSH,ASTR, , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F1 , F2 , F3 , F4 , F5 ,LCBR, RCBR, 7 , 8 , 9 ,MINS, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F6 , F7 , F8 , F9 ,F10 ,LPRN, RPRN, 4 , 5 , 6 ,PLUS, , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - F11 ,F12 ,PSCR,SLCK,PAUS,LBRC,LOCK, ,RBRC, 1 , 2 , 3 , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - HOME,PGDN,PGUP,END ,TMB9, , , , , 0 ,HOME,PGDN,PGUP,END - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + //,----+----+------+------+------+----. ,----+------+------+-------+----+----. + PSCR, , , , , , , , , , , , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + , , LCBR , LBRC , LPRN , , , RPRN , RBRC , RCBR , , , + //|----+----+------+------+------+----| |----+------+------+-------+----+----| + F1 , F2 ,LA(F3),LG(F4),LC(F5), F6 , F7 ,RS(F8),RG(F9),RA(F10),F11 ,F12 , + //|----+----+------+------+------+----+----. ,----+----+------+------+-------+----+----| + , , HOME , PGDN , PGUP ,END , , ,LEFT, DOWN , UP , RGHT , , , + //|----+----+------+------+------+----+----| |----+----+------+------+-------+----+----| + , , , , , , NO , MAC ,TMB7, , , , , + //`----+----+------+------+------+----+----/ \----+----+------+------+-------+----+----' ), [_RAISE] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , ,SLSH,ASTR, , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F1 , F2 , F3 , F4 , F5 ,LCBR, RCBR, 7 , 8 , 9 ,MINS, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F6 , F7 , F8 , F9 ,F10 ,LPRN, RPRN, 4 , 5 , 6 ,PLUS, , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - F11 ,F12 ,PSCR,SLCK,PAUS,LBRC,LOCK, ,RBRC, 1 , 2 , 3 , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - HOME,PGDN,PGUP,END ,TMB9, , , , , 0 ,HOME,PGDN,PGUP,END - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' - ), - - [_ADJUST] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , ,EXTOFF, , ,EXTON, , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,RST ,DBUG,RTOG,WIN , , ,MAC ,QWER,EDJP, , , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - , , , , , , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , , , , , - //`----+----+----+----+----+----+----/ \----+----+----+----+----+----+----' + //,----+----+-----+-----+-----+----. ,----+-----+-----+-----+----+----. + PSCR, , , , , , , , , , , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + , ,EXLM , AT ,HASH ,DLR , PERC,CIRC ,AMPR ,ASTR , , , + //|----+----+-----+-----+-----+----| |----+-----+-----+-----+----+----| + , 1 ,LA(2),LG(3),LC(4), 5 , 6 ,RS(7),RG(8),RA(9), 0 , , + //|----+----+-----+-----+-----+----+----. ,----+----+-----+-----+-----+----+----| + , ,HOME ,PGDN ,PGUP ,END , , ,LEFT,DOWN , UP ,RGHT , , , + //|----+----+-----+-----+-----+----+----| |----+----+-----+-----+-----+----+----| + , , , , , ,WIN , NO , , , , , , + //`----+----+-----+-----+-----+----+----/ \----+----+-----+-----+-----+----+----' ) }; diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_xrows.h b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_xrows.h index 6a0e58102..d9561d0b7 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_xrows.h +++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_xrows.h @@ -2,27 +2,20 @@ #define KEYMAP_XROWS_H #include "edvorakjp.h" - -enum custom_keycodes { - KC_LOCK = NEW_SAFE_RANGE, -}; +/* + * enum custom_keycodes { + * KC_LOCK = NEW_SAFE_RANGE, + * }; + */ #define KC_ KC_TRNS -#define KC_TMB1 LGUI_T(KC_TAB) -#define KC_TMB2 LSFT_T(KC_SPC) -#define KC_TMB3 LOWER // act as LOWER when hold, as KC_LANG2(=English) when tapped -#define KC_TMB4 LCTL_T(KC_ESC) -#define KC_TMB5 RSFT_T(KC_DEL) -#define KC_TMB6 RAISE // act as RAISE when hold, as KC_LANG1(=Japanese) when tapped -#define KC_TMB7 RCTL_T(KC_BSPC) -#define KC_TMB8 RALT_T(KC_ENT) -#define KC_TMB9 LGUI(KC_TAB) - -#define KC_RST RESET -#define KC_DBUG DEBUG -#define KC_RTOG RGB_TOG -#define KC_EDJP EDVORAK -#define KC_QWER QWERTY +#define KC_TMB1 KC_LA(TAB) +#define KC_TMB2 KC_LS(SPC) +#define KC_TMB3 TD(TD_LOWER) // act as LOWER when hold, as KC_LANG2(=English) when tapped +#define KC_TMB4 TD(TD_RAISE) // act as RAISE when hold, as KC_LANG1(=Japanese) when tapped +#define KC_TMB5 KC_RC(BSPC) +#define KC_TMB6 KC_RG(ENT) +#define KC_TMB7 KC_RC(DEL) #endif diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/oled.c b/keyboards/helix/rev2/keymaps/edvorakjp/oled.c index 227e2c56f..b931b72b7 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/oled.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/oled.c @@ -34,13 +34,7 @@ void render_status(struct CharacterMatrix *matrix) { matrix_write_P(matrix, PSTR("\nLayer: ")); switch (biton32(layer_state)) { case L_BASE: - matrix_write_P(matrix, - default_layer_state == 1UL<<_EDVORAK ? PSTR("EDVORAK") : PSTR("QWERTY") - ); - break; - case _EDVORAKJ1: - case _EDVORAKJ2: - matrix_write_P(matrix, PSTR("JP_EXT")); + matrix_write_P(matrix, PSTR("Default")); break; case _RAISE: matrix_write_P(matrix, PSTR("Raise")); @@ -48,17 +42,13 @@ void render_status(struct CharacterMatrix *matrix) { case _LOWER: matrix_write_P(matrix, PSTR("Lower")); break; - case _ADJUST: - matrix_write_P(matrix, PSTR("Adjust")); - break; default: matrix_write(matrix, buf); } // Host Keyboard LED Status char led[40]; - snprintf(led, sizeof(led), "\n%s %s %s %s", - get_enable_jp_extra_layer() && get_japanese_mode() ? "EXT" : " ", + snprintf(led, sizeof(led), "\n%s %s %s", (host_keyboard_leds() & (1<event.pressed) { - if (get_enable_kc_lang()) { - SEND_STRING( SS_LCTRL(SS_LSFT(SS_TAP(X_POWER))) ); - } else { - SEND_STRING( SS_LGUI("l") ); - } - } - return false; - } - return true; -} - +#ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT uint32_t layer_state_set_keymap(uint32_t state) { + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); switch (biton32(state)) { - case _EDVORAKJ1: - case _EDVORAKJ2: - // _EDVORAKJ1 & J2 are same colored - rgblight_setrgb (0xFF, 0xFF, 0xFF); - break; case _LOWER: - rgblight_setrgb (0xFF, 0x00, 0x00); + rgblight_sethsv_noeeprom_red(); break; case _RAISE: - rgblight_setrgb (0x00, 0x00, 0xFF); + rgblight_sethsv_noeeprom_blue(); break; - case _ADJUST: - rgblight_setrgb (0x00, 0xFF, 0x00); - break; - default: // for any other layers, or the default layer - rgblight_mode(28); + default: // for any other layers, or the default layer + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 3); + get_japanese_mode() ? rgblight_sethsv_noeeprom_red() : rgblight_sethsv_noeeprom_green(); break; } return state; } +#endif diff --git a/keyboards/keebio/iris/keymaps/edvorakjp/rules.mk b/keyboards/keebio/iris/keymaps/edvorakjp/rules.mk index 58d244c38..4ee94a983 100644 --- a/keyboards/keebio/iris/keymaps/edvorakjp/rules.mk +++ b/keyboards/keebio/iris/keymaps/edvorakjp/rules.mk @@ -2,15 +2,17 @@ # change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +TAP_DANCE_ENABLE = yes diff --git a/users/edvorakjp/edvorakjp.c b/users/edvorakjp/edvorakjp.c index 1ac610794..892ce4be3 100644 --- a/users/edvorakjp/edvorakjp.c +++ b/users/edvorakjp/edvorakjp.c @@ -1,10 +1,5 @@ #include "edvorakjp.h" -void dvorakj_layer_off(void) { - layer_off(_EDVORAKJ1); - layer_off(_EDVORAKJ2); -} - void matrix_init_user(void) { edvorakjp_status_init(); matrix_init_keymap(); @@ -25,7 +20,6 @@ uint32_t layer_state_set_keymap(uint32_t state) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { return process_record_keymap(keycode, record) &&\ - process_record_edvorakjp_ext(keycode, record) &&\ process_record_edvorakjp_swap_scln(keycode, record) &&\ process_record_edvorakjp_config(keycode, record) &&\ process_record_layer(keycode, record) &&\ diff --git a/users/edvorakjp/edvorakjp.h b/users/edvorakjp/edvorakjp.h index e781bf237..688cdeffb 100644 --- a/users/edvorakjp/edvorakjp.h +++ b/users/edvorakjp/edvorakjp.h @@ -10,9 +10,6 @@ extern keymap_config_t keymap_config; enum edvorakjp_layers { _EDVORAK = 0, - _EDVORAKJ1, - _EDVORAKJ2, - _QWERTY, _LOWER, _RAISE, _ADJUST, @@ -21,26 +18,24 @@ enum edvorakjp_layers { enum edvorakjp_keycodes { EDVORAK = SAFE_RANGE, - QWERTY, LOWER, RAISE, KC_MAC, KC_WIN, - KC_EXTON, - KC_EXTOFF, KC_JPN, KC_ENG, - KC_AI, - KC_OU, - KC_EI, - KC_ANN, - KC_ONN, - KC_ENN, - KC_INN, - KC_UNN, NEW_SAFE_RANGE }; +#define KC_LC(k) LCTL_T(KC_##k) +#define KC_LS(k) LSFT_T(KC_##k) +#define KC_LA(k) LALT_T(KC_##k) +#define KC_LG(k) LGUI_T(KC_##k) +#define KC_RC(k) RCTL_T(KC_##k) +#define KC_RS(k) RSFT_T(KC_##k) +#define KC_RG(k) RGUI_T(KC_##k) +#define KC_RA(k) RALT_T(KC_##k) + enum tap_dance_code { TD_LOWER = 0, TD_RAISE @@ -57,8 +52,6 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record); // status void edvorakjp_status_init(void); -bool get_enable_jp_extra_layer(void); -void set_enable_jp_extra_layer(bool new_state); bool get_enable_kc_lang(void); void set_enable_kc_lang(bool new_state); bool get_japanese_mode(void); @@ -69,7 +62,6 @@ void set_japanese_mode(bool new_state); * return false if processed, or return true if not processed. * You can add your original macros in process_record_keymap() in keymap.c. */ -bool process_record_edvorakjp_ext(uint16_t keycode, keyrecord_t *record); bool process_record_edvorakjp_swap_scln(uint16_t keycode, keyrecord_t *record); bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record); bool process_record_layer(uint16_t keycode, keyrecord_t *record); diff --git a/users/edvorakjp/edvorakjp_process_record.c b/users/edvorakjp/edvorakjp_process_record.c index 2dcdab2a2..ecc8db936 100644 --- a/users/edvorakjp/edvorakjp_process_record.c +++ b/users/edvorakjp/edvorakjp_process_record.c @@ -7,114 +7,6 @@ static uint16_t time_on_pressed; * Each process_record_* methods defined here are * return false if handle edvorak_keycodes, or return true others. */ -bool process_record_edvorakjp_ext(uint16_t keycode, keyrecord_t *record) { - if (!(default_layer_state == 1UL<<_EDVORAK && - get_enable_jp_extra_layer() && get_japanese_mode())) { - return true; - } - - // consonant keys - // layer_on(J1) or layer_on(J2) are defined based on key positions. - switch (keycode) { - // right hand's left side w/o N - case KC_F: - case KC_G: - case KC_R: - case KC_D: - case KC_T: - case KC_B: - case KC_H: - case KC_J: - if (record->event.pressed) { - layer_on(_EDVORAKJ1); - } - return true; - - // N: toggle layer - case KC_N: - if (record->event.pressed) { - biton32(layer_state) == _EDVORAK ? layer_on(_EDVORAKJ1) : dvorakj_layer_off(); - } - return true; - - // left hand up and right hand's right side - case KC_Y: - case KC_P: - case KC_W: - case KC_Q: - case KC_S: - case KC_M: - case KC_K: - case KC_L: - if (record->event.pressed) { - layer_on(_EDVORAKJ2); - } - return true; - // left hand down - // If return true, QMK sends keycode in new layer, - // but these keys are only available in old layer. - case KC_X: - case KC_C: - case KC_V: - case KC_Z: - if (record->event.pressed) { - layer_on(_EDVORAKJ2); - tap_code(keycode); - } - return false; - } - - // vowel keys, symbol keys and modifier keys - if (record->event.pressed) { - dvorakj_layer_off(); - } - switch (keycode) { - // combination vowel keys - case KC_AI: - if (record->event.pressed) { - SEND_STRING("ai"); - } - return false; - case KC_OU: - if (record->event.pressed) { - SEND_STRING("ou"); - } - return false; - case KC_EI: - if (record->event.pressed) { - SEND_STRING("ei"); - } - return false; - case KC_ANN: - if (record->event.pressed) { - SEND_STRING("ann"); - } - return false; - case KC_ONN: - if (record->event.pressed) { - SEND_STRING("onn"); - } - return false; - case KC_ENN: - if (record->event.pressed) { - SEND_STRING("enn"); - } - return false; - case KC_INN: - if (record->event.pressed) { - SEND_STRING("inn"); - } - return false; - case KC_UNN: - if (record->event.pressed) { - SEND_STRING("unn"); - } - return false; - } - // AOEIU and other (symbol, modifier) keys - return true; -} - bool process_record_edvorakjp_swap_scln(uint16_t keycode, keyrecord_t *record) { #ifdef SWAP_SCLN static const uint8_t shift_bits = MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT); @@ -146,30 +38,13 @@ bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record) { set_enable_kc_lang(keycode == KC_MAC); } return false; - case KC_EXTON: - case KC_EXTOFF: - if (record->event.pressed) { - set_enable_jp_extra_layer(keycode == KC_EXTON); - } - return false; } return true; } bool process_record_layer(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case EDVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_EDVORAK); - } - return false; - case QWERTY: - if (record->event.pressed) { - dvorakj_layer_off(); - set_single_persistent_default_layer(_QWERTY); - } - return false; #if TAP_DANCE_ENABLE != yes + switch (keycode) { case LOWER: if (record->event.pressed) { layer_on(_LOWER); @@ -196,8 +71,8 @@ bool process_record_layer(uint16_t keycode, keyrecord_t *record) { time_on_pressed = 0; } return false; -#endif } +#endif return true; } diff --git a/users/edvorakjp/edvorakjp_status.c b/users/edvorakjp/edvorakjp_status.c index a60c8d853..128fc3bd2 100644 --- a/users/edvorakjp/edvorakjp_status.c +++ b/users/edvorakjp/edvorakjp_status.c @@ -4,8 +4,7 @@ typedef union { uint8_t raw; struct { - bool enable_jp_extra_layer : 1; - bool enable_kc_lang : 1; // for macOS + bool enable_kc_lang; // for macOS }; } edvorakjp_config_t; static edvorakjp_config_t edvorakjp_config; @@ -34,15 +33,6 @@ void edvorakjp_status_init(void) { edvorakjp_config.raw = eeconfig_read_edvorakjp(); } -bool get_enable_jp_extra_layer(void) { - return edvorakjp_config.enable_jp_extra_layer; -} - -void set_enable_jp_extra_layer(bool new_state) { - edvorakjp_config.enable_jp_extra_layer = new_state; - eeconfig_update_edvorakjp(edvorakjp_config.raw); -} - bool get_enable_kc_lang(void) { return edvorakjp_config.enable_kc_lang; } @@ -65,7 +55,6 @@ void set_japanese_mode(bool new_state) { SEND_STRING(SS_LALT("`")); } } else { - dvorakj_layer_off(); if (edvorakjp_config.enable_kc_lang) { SEND_STRING(SS_TAP(X_LANG2)); } else { diff --git a/users/edvorakjp/edvorakjp_tap_dance.c b/users/edvorakjp/edvorakjp_tap_dance.c index 62c0c100a..d5369f926 100644 --- a/users/edvorakjp/edvorakjp_tap_dance.c +++ b/users/edvorakjp/edvorakjp_tap_dance.c @@ -8,8 +8,11 @@ enum tap_state { HOLD }; -static int td_status_lower = NONE; -static int td_status_raise = NONE; +typedef struct { + uint8_t lower; + uint8_t raise; +} td_status_t; +static td_status_t td_status = {NONE, NONE}; int cur_dance(qk_tap_dance_state_t *state) { if (state->interrupted || !state->pressed) { @@ -20,14 +23,14 @@ int cur_dance(qk_tap_dance_state_t *state) { } void td_lower_finished(qk_tap_dance_state_t *state, void *user_data) { - td_status_lower = cur_dance(state); - switch(td_status_lower) { + td_status.lower = cur_dance(state); + switch(td_status.lower) { case SINGLE_TAP: set_japanese_mode(false); - register_code(KC_ESC); break; case DOUBLE_TAP: set_japanese_mode(false); + register_code(KC_ESC); break; case HOLD: break; @@ -36,18 +39,19 @@ void td_lower_finished(qk_tap_dance_state_t *state, void *user_data) { } void td_lower_reset(qk_tap_dance_state_t *state, void *user_data) { - if (td_status_lower == SINGLE_TAP) { + if (td_status.lower == DOUBLE_TAP) { unregister_code(KC_ESC); } layer_off(_LOWER); - td_status_lower = NONE; + td_status.lower = NONE; } void td_raise_finished(qk_tap_dance_state_t *state, void *user_data) { - td_status_raise = cur_dance(state); - switch(td_status_raise) { - case SINGLE_TAP: + td_status.raise = cur_dance(state); + switch(td_status.raise) { case DOUBLE_TAP: + // same as single + case SINGLE_TAP: set_japanese_mode(true); break; case HOLD: @@ -58,14 +62,12 @@ void td_raise_finished(qk_tap_dance_state_t *state, void *user_data) { void td_raise_reset(qk_tap_dance_state_t *state, void *user_data) { layer_off(_RAISE); - td_status_raise = NONE; + td_status.raise = NONE; } qk_tap_dance_action_t tap_dance_actions[] = { - [TD_LOWER] = ACTION_TAP_DANCE_FN_ADVANCED_TIME( - NULL, td_lower_finished, td_lower_reset, TAPPING_TERM * 1.5 - ), - [TD_RAISE] = ACTION_TAP_DANCE_FN_ADVANCED_TIME( - NULL, td_raise_finished, td_raise_reset, TAPPING_TERM * 1.5 - ) + [TD_LOWER] = + ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, td_lower_finished, td_lower_reset, 100), + [TD_RAISE] = + ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, td_raise_finished, td_raise_reset, 100) }; diff --git a/users/edvorakjp/readme.md b/users/edvorakjp/readme.md index 077ba4abd..679d84b3d 100644 --- a/users/edvorakjp/readme.md +++ b/users/edvorakjp/readme.md @@ -5,49 +5,20 @@ epaew's Enhanced Dvorak layout for Japanese Programmer ## Layout overview This is a sample. You can swap any symbol keys and modifier keys. -- Base layer (for ansi layout) +- Basic layout (for ansi) ``` //+----+----+----+----+----+----+----+----+----+----+----+----+----+---------+ ` , ! , @ , # , $ , % , ^ , & , * , ( , ) , [ , ] , BSPC , //+----+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-------+ - TAB , ' , , , . , Y , P , F , G , R , W , Q , / , = , \ , + TAB , ' , , , . , Y , Q , F , G , R , W , P , / , = , \ , //+------++---++---++---++---++---++---++---++---++---++---++---++---+-------+ CAPS , A , O , E , I , U , D , T , N , S , M , - , ENT , //+-------+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-----------+ - LSFT , ; , X , C , V , Z , B , H , J , K , L , RSFT , + LSFT , : , X , C , V , Z , H , J , K , L , B , RSFT , //+------+--+---++----++---+----+----+----+----+-+--+---++----++------+------+ LCTL , LGUI , LALT , SPACE , RALT , RGUI , MENU , RCTL //+------+------+------+-------------------------+------+------+------+------+ ``` -- Base layer (for iso layout) - - Two C keys are placed, it's on purpose. -``` - //+----+----+----+----+----+----+----+----+----+----+----+----+----+---------+ - ` , ! , @ , # , $ , % , ^ , & , * , ( , ) , [ , ] , BSPC , - //+----+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-------+ - TAB , ' , , , . , Y , P , F , G , R , W , C , / , = , - //+------++---++---++---++---++---++---++---++---++---++---++---++---++ - CAPS , A , O , E , I , U , D , T , N , S , M , ; , - , ENT , - //+-------+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+------+ - LSFT , Q , X , C , V , Z , B , H , J , K , L , \ , RSFT , - //+------+--+---++----++---+----+----+----+----+-+--+---++----++---+--+------+ - LCTL , LGUI , LALT , SPACE , RALT , RGUI , MENU , RCTL - //+------+------+------+-------------------------+------+------+------+------+ -``` -- Additional layer (common, blanks are transparent) -``` - //+----+----+----+----+----+----+----+----+----+----+----+----+----+---------+ - , , , , , , , , , , , , , , - //+----+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-------+ - , AI , OU , EI , , , , , , , , , , , - //+------++---++---++---++---++---++---++---++---++---++---++---++---+-------+ - , A , O , E , I , U , , Y1 , N , Y2 , , , , - //+-------+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-----------+ - ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , - //+------+--+---++----++---+----+----+----+----+-+--+---++----++------+------+ - , , , , , , , - //+------+------+------+-------------------------+------+------+------+------+ -``` And you can see [my iris keyboard layout](../../keyboards/iris/keymaps/edvorakjp/keymap.c) for sample implementation, too. @@ -57,36 +28,25 @@ This is a sample. You can swap any symbol keys and modifier keys. - IME 切り替えキー - 長押しでレイヤー切り替え、短押しでIME切り替え - macOS(かな/英数)、Windows(Alt+\`)の両方に対応 - - DvorakJP()を参考にした日本語入力用キーの導入 - - 拗音入力用のYキーを追加配置 - - 二重母音入力用のキー(AI, OU, EI) - - 撥音入力用のキー(ANN, ONN, ENN, INN, UNN) - - いずれかの子音を押下することで Additional layer が出現し、いずれかの母音を押下することで Base layer に戻ります(※1※2) - - ※1促音の入力に使うため、また連続で同じ指での打鍵を減らすために、 - FGRDTNBHJ を押下した場合はy1が、それ以外の子音を押下した場合はy2が出現しません - - ※2撥音の入力のため、nを2連打すると、Base layerに戻ります - Define some custom keys for typing Japanese - IME switching - act as LOWER/RAISE when hold, act as IME switching when tapped - for macOS(かな/英数), for Windows(Alt+\`) - - oneshot combination keys, inspired from DvorakJP () - - additional Y key to enter a contracted sound - - diphthong keys (AI, OU, EI) - - syllabic nasal (ANN, ONN, ENN, INN, UNN) - - Additional layer is appeared when you taps any consonant keys, and disappeared when you taps any diphthong keys. ## for Programmer - Dvorak 配列をベースに、ショートカットでよく利用される XCV は QWERTY 配列の位置を維持 - 一部にVimユーザ用のキー配置を実施 - HJKL キーを横並びで配置 - - Shift押下時と非押下時で、";"キーの挙動を入れ替え(`config.h` 内で `#define SWAP_SCLN` の宣言が必要です) + - Shift押下時と非押下時で、";"キーの挙動を入れ替え + (`config.h` 内で `#define SWAP_SCLN` の宣言が必要です) - デフォルトレイヤーには、数字キーの代わりに記号 `!@#$%^&*()` を配置 - mainly based on Dvorak layout, but XCV is available in the same position of QWERTY layout - for Vim users - HJKL is lining side by side - - swap the ";" key behavior. i.e. send ":" normally and send ";" when you hold shift. (need `#define SWAP_SCLN` in your `config.h`) + - swap the ";" key behavior. i.e. send ":" normally and send ";" when you hold shift. + (need `#define SWAP_SCLN` in your `config.h`) - we can type `!@#$%^&*()` keys without shift keys in base layer ## License