From d9d42552fd0e9ab61345c035253ea29851d7c9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Tue, 23 Oct 2018 21:15:34 +0200 Subject: [PATCH] Use cycle_unicode_input_mode in whitefox/konstantin --- keyboards/whitefox/keymaps/konstantin/config.h | 3 +++ keyboards/whitefox/keymaps/konstantin/keymap.c | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/keyboards/whitefox/keymaps/konstantin/config.h b/keyboards/whitefox/keymaps/konstantin/config.h index 39450d68026..8497e703069 100644 --- a/keyboards/whitefox/keymaps/konstantin/config.h +++ b/keyboards/whitefox/keymaps/konstantin/config.h @@ -13,5 +13,8 @@ #define TAPPING_TERM 200 #define TAPPING_TOGGLE 2 +#define UNICODE_CYCLE_PERSIST false +#define UNICODE_SELECTED_MODES UC_WINC, UC_LNX + #undef IS_COMMAND #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RCTL))) diff --git a/keyboards/whitefox/keymaps/konstantin/keymap.c b/keyboards/whitefox/keymaps/konstantin/keymap.c index edb049287c2..ac03d675597 100644 --- a/keyboards/whitefox/keymaps/konstantin/keymap.c +++ b/keyboards/whitefox/keymaps/konstantin/keymap.c @@ -19,10 +19,6 @@ #define UC_DIVS UC(0x00F7) #define UC_MINS UC(0x2212) -void matrix_init_user(void) { - set_unicode_input_mode(UC_WINC); -} - enum layers { L_BASE, L_FN, @@ -31,6 +27,7 @@ enum layers { enum custom_keycodes { CLEAR = SAFE_RANGE, + CYCLEUC, NUMPAD, }; @@ -40,6 +37,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); } return false; + case CYCLEUC: + if (record->event.pressed) { cycle_unicode_input_mode(); } + return false; + case NUMPAD: if (record->event.pressed) { layer_invert(L_NUMPAD); @@ -104,7 +105,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,---------------------------------------------------------------. * | |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Num|Scr|Pau| * |---------------------------------------------------------------| - * | M4 |M2 |M↑ |M1 |M3 |M5 | | | |Stp|Ply|Prv|Nxt|Clear|Ins| + * | M4 |M2 |M↑ |M1 |M3 |M5 | |Cyc| |Stp|Ply|Prv|Nxt|Clear|Ins| * |---------------------------------------------------------------| * | |M← |M↓ |M→ |MW↑| | | | | | | | |Top| * |---------------------------------------------------------------| @@ -115,7 +116,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [L_FN] = LAYOUT_truefox( \ _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK,KC_PAUS, \ - KC_BTN4,KC_BTN2,KC_MS_U,KC_BTN1,KC_BTN3,KC_BTN5,_______,_______,_______,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,CLEAR, KC_INS, \ + KC_BTN4,KC_BTN2,KC_MS_U,KC_BTN1,KC_BTN3,KC_BTN5,_______,CYCLEUC,_______,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,CLEAR, KC_INS, \ _______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_U,_______,_______,_______,_______,_______,_______,_______, _______, TOP, \ _______, KC_ACL0,KC_ACL2,KC_WH_L,KC_WH_R,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MUTE,KC_APP, KC_PGUP,BOTTOM, \ _______,DESKTOP,DESKT_L, KC_WH_D, DESKT_R,_______, KC_HOME,KC_PGDN,KC_END \