Skip to content

Commit f4ded78

Browse files
author
Konstantin Đorđević
committed
Add keycodes: UNICODE_MODE_FORWARD, UNICODE_MODE_REVERSE
Aliases: UC_MOD, UC_RMOD (respectively)
1 parent 1a19eb7 commit f4ded78

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

keyboards/whitefox/keymaps/konstantin/keymap.c

+2-7
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ enum layers {
2727

2828
enum custom_keycodes {
2929
CLEAR = SAFE_RANGE,
30-
CYCLEUC,
3130
NUMPAD,
3231
};
3332

@@ -37,10 +36,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
3736
if (record->event.pressed) { SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); }
3837
return false;
3938

40-
case CYCLEUC:
41-
if (record->event.pressed) { cycle_unicode_input_mode(+1); }
42-
return false;
43-
4439
case NUMPAD:
4540
if (record->event.pressed) {
4641
layer_invert(L_NUMPAD);
@@ -105,7 +100,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
105100
* ,---------------------------------------------------------------.
106101
* | |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Num|Scr|Pau|
107102
* |---------------------------------------------------------------|
108-
* | M4 |M2 |M↑ |M1 |M3 |M5 | |Cyc| |Stp|Ply|Prv|Nxt|Clear|Ins|
103+
* | M4 |M2 |M↑ |M1 |M3 |M5 | |UCM| |Stp|Ply|Prv|Nxt|Clear|Ins|
109104
* |---------------------------------------------------------------|
110105
* | |M← |M↓ |M→ |MW↑| | | | | | | | |Top|
111106
* |---------------------------------------------------------------|
@@ -116,7 +111,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
116111
*/
117112
[L_FN] = LAYOUT_truefox( \
118113
_______,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, \
119-
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, \
114+
KC_BTN4,KC_BTN2,KC_MS_U,KC_BTN1,KC_BTN3,KC_BTN5,_______,UC_MOD, _______,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,CLEAR, KC_INS, \
120115
_______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_U,_______,_______,_______,_______,_______,_______,_______, _______, TOP, \
121116
_______, KC_ACL0,KC_ACL2,KC_WH_L,KC_WH_R,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MUTE,KC_APP, KC_PGUP,BOTTOM, \
122117
_______,DESKTOP,DESKT_L, KC_WH_D, DESKT_R,_______, KC_HOME,KC_PGDN,KC_END \

quantum/process_keycode/process_unicode_common.c

+6
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,12 @@ void send_unicode_hex_string(const char *str) {
168168
bool process_unicode_common(uint16_t keycode, keyrecord_t *record) {
169169
if (record->event.pressed) {
170170
switch (keycode) {
171+
case UNICODE_MODE_FORWARD:
172+
cycle_unicode_input_mode(+1);
173+
break;
174+
case UNICODE_MODE_BACKWARD:
175+
cycle_unicode_input_mode(-1);
176+
break;
171177
case UNICODE_MODE_OSX:
172178
set_unicode_input_mode(UC_OSX);
173179
#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_OSX)

quantum/quantum_keycodes.h

+4
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,8 @@ enum quantum_keycodes {
451451
TERM_OFF,
452452
#endif
453453

454+
UNICODE_MODE_FORWARD,
455+
UNICODE_MODE_REVERSE,
454456
UNICODE_MODE_OSX,
455457
UNICODE_MODE_LNX,
456458
UNICODE_MODE_WIN,
@@ -685,6 +687,8 @@ enum quantum_keycodes {
685687
#define X(n) (QK_UNICODE_MAP | (n))
686688
#endif
687689

690+
#define UC_MOD UNICODE_MODE_FORWARD
691+
#define UC_RMOD UNICODE_MODE_REVERSE
688692
#define UC_M_OS UNICODE_MODE_OSX
689693
#define UC_M_LN UNICODE_MODE_LNX
690694
#define UC_M_WI UNICODE_MODE_WIN

0 commit comments

Comments
 (0)