Add keycodes: UNICODE_MODE_FORWARD, UNICODE_MODE_REVERSE

Aliases: UC_MOD, UC_RMOD (respectively)
This commit is contained in:
Konstantin Đorđević 2018-11-05 20:38:02 +01:00
parent 1a19eb78f1
commit f4ded78f1b
3 changed files with 12 additions and 7 deletions

View File

@ -27,7 +27,6 @@ enum layers {
enum custom_keycodes { enum custom_keycodes {
CLEAR = SAFE_RANGE, CLEAR = SAFE_RANGE,
CYCLEUC,
NUMPAD, NUMPAD,
}; };
@ -37,10 +36,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); } if (record->event.pressed) { SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); }
return false; return false;
case CYCLEUC:
if (record->event.pressed) { cycle_unicode_input_mode(+1); }
return false;
case NUMPAD: case NUMPAD:
if (record->event.pressed) { if (record->event.pressed) {
layer_invert(L_NUMPAD); layer_invert(L_NUMPAD);
@ -105,7 +100,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ,---------------------------------------------------------------. * ,---------------------------------------------------------------.
* | |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Num|Scr|Pau| * | |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Num|Scr|Pau|
* |---------------------------------------------------------------| * |---------------------------------------------------------------|
* | M4 |M2 |M |M1 |M3 |M5 | |Cyc| |Stp|Ply|Prv|Nxt|Clear|Ins| * | M4 |M2 |M |M1 |M3 |M5 | |UCM| |Stp|Ply|Prv|Nxt|Clear|Ins|
* |---------------------------------------------------------------| * |---------------------------------------------------------------|
* | |M |M |M |MW| | | | | | | | |Top| * | |M |M |M |MW| | | | | | | | |Top|
* |---------------------------------------------------------------| * |---------------------------------------------------------------|
@ -116,7 +111,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/ */
[L_FN] = LAYOUT_truefox( \ [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_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,_______,CYCLEUC,_______,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,CLEAR, KC_INS, \ 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, \
_______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_U,_______,_______,_______,_______,_______,_______,_______, _______, TOP, \ _______,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, \ _______, 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 \ _______,DESKTOP,DESKT_L, KC_WH_D, DESKT_R,_______, KC_HOME,KC_PGDN,KC_END \

View File

@ -168,6 +168,12 @@ void send_unicode_hex_string(const char *str) {
bool process_unicode_common(uint16_t keycode, keyrecord_t *record) { bool process_unicode_common(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {
switch (keycode) { switch (keycode) {
case UNICODE_MODE_FORWARD:
cycle_unicode_input_mode(+1);
break;
case UNICODE_MODE_BACKWARD:
cycle_unicode_input_mode(-1);
break;
case UNICODE_MODE_OSX: case UNICODE_MODE_OSX:
set_unicode_input_mode(UC_OSX); set_unicode_input_mode(UC_OSX);
#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_OSX) #if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_OSX)

View File

@ -451,6 +451,8 @@ enum quantum_keycodes {
TERM_OFF, TERM_OFF,
#endif #endif
UNICODE_MODE_FORWARD,
UNICODE_MODE_REVERSE,
UNICODE_MODE_OSX, UNICODE_MODE_OSX,
UNICODE_MODE_LNX, UNICODE_MODE_LNX,
UNICODE_MODE_WIN, UNICODE_MODE_WIN,
@ -685,6 +687,8 @@ enum quantum_keycodes {
#define X(n) (QK_UNICODE_MAP | (n)) #define X(n) (QK_UNICODE_MAP | (n))
#endif #endif
#define UC_MOD UNICODE_MODE_FORWARD
#define UC_RMOD UNICODE_MODE_REVERSE
#define UC_M_OS UNICODE_MODE_OSX #define UC_M_OS UNICODE_MODE_OSX
#define UC_M_LN UNICODE_MODE_LNX #define UC_M_LN UNICODE_MODE_LNX
#define UC_M_WI UNICODE_MODE_WIN #define UC_M_WI UNICODE_MODE_WIN