From aab70da97aacac0c29689f1d08956295bbfdb494 Mon Sep 17 00:00:00 2001 From: Reibl Janos Daniel Date: Mon, 18 Oct 2021 16:39:35 +0200 Subject: [PATCH 1/2] Simplify unicode input mode change and CTRL and GUI swapping --- layouts/community/ortho_5x12/riblee/keymap.c | 12 ++++++------ users/riblee/riblee.c | 14 ++++++++++++++ users/riblee/riblee.h | 4 +++- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/layouts/community/ortho_5x12/riblee/keymap.c b/layouts/community/ortho_5x12/riblee/keymap.c index b34217bff4b7..785711ac8ec3 100644 --- a/layouts/community/ortho_5x12/riblee/keymap.c +++ b/layouts/community/ortho_5x12/riblee/keymap.c @@ -189,17 +189,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | | |Mu mod|Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| HUN |Wrkmn | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | NKRO | Swap |Un swp|UC Mod| | | + * | | | | | | | NKRO | Mac |Linux | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_ADJUST] = LAYOUT_ortho_5x12( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, - _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,KC_INS, KC_PSCR, KC_DEL, - _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, HUNGARIAN, WORKMAN, - _______, _______, _______, _______, _______, _______, NK_TOGG, LCG_SWP, LCG_NRM, UC_MOD, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF, KC_INS, KC_PSCR, KC_DEL, + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, HUNGARIAN, WORKMAN, + _______, _______, _______, _______, _______, _______, NK_TOGG, MAC, LINUX, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; \ No newline at end of file diff --git a/users/riblee/riblee.c b/users/riblee/riblee.c index 4bfa298c4a38..c47cb1249c6b 100644 --- a/users/riblee/riblee.c +++ b/users/riblee/riblee.c @@ -175,6 +175,20 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case MAC: + set_unicode_input_mode(UC_MAC); + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.swap_lctl_lgui = false; + eeconfig_update_keymap(keymap_config.raw); + clear_keyboard(); + break; + case LINUX: + set_unicode_input_mode(UC_LNX); + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.swap_lctl_lgui = true; + eeconfig_update_keymap(keymap_config.raw); + clear_keyboard(); + break; } return true; }; diff --git a/users/riblee/riblee.h b/users/riblee/riblee.h index f7340d50b2f7..0eb0da97b364 100644 --- a/users/riblee/riblee.h +++ b/users/riblee/riblee.h @@ -35,7 +35,9 @@ enum custom_keycodes { COLEMAK, DVORAK, WORKMAN, - BACKLIT + BACKLIT, + MAC, + LINUX }; #define LOWER MO(_LOWER) From 31f3b7dd5b92ae5fb940dce6697501cb67b7e327 Mon Sep 17 00:00:00 2001 From: Reibl Janos Daniel Date: Tue, 19 Oct 2021 17:00:40 +0200 Subject: [PATCH 2/2] Use `CG_NORM` and `CG_SWAP` instead of custom keycodes --- layouts/community/ortho_5x12/riblee/keymap.c | 2 +- users/riblee/riblee.c | 12 ++---------- users/riblee/riblee.h | 4 +--- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/layouts/community/ortho_5x12/riblee/keymap.c b/layouts/community/ortho_5x12/riblee/keymap.c index 785711ac8ec3..b72248375981 100644 --- a/layouts/community/ortho_5x12/riblee/keymap.c +++ b/layouts/community/ortho_5x12/riblee/keymap.c @@ -198,7 +198,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF, KC_INS, KC_PSCR, KC_DEL, _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, HUNGARIAN, WORKMAN, - _______, _______, _______, _______, _______, _______, NK_TOGG, MAC, LINUX, _______, _______, _______, + _______, _______, _______, _______, _______, _______, NK_TOGG, CG_NORM, CG_SWAP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) diff --git a/users/riblee/riblee.c b/users/riblee/riblee.c index c47cb1249c6b..1ca655d8f2c3 100644 --- a/users/riblee/riblee.c +++ b/users/riblee/riblee.c @@ -175,19 +175,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case MAC: + case CG_NORM: set_unicode_input_mode(UC_MAC); - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.swap_lctl_lgui = false; - eeconfig_update_keymap(keymap_config.raw); - clear_keyboard(); break; - case LINUX: + case CG_SWAP: set_unicode_input_mode(UC_LNX); - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.swap_lctl_lgui = true; - eeconfig_update_keymap(keymap_config.raw); - clear_keyboard(); break; } return true; diff --git a/users/riblee/riblee.h b/users/riblee/riblee.h index 0eb0da97b364..f7340d50b2f7 100644 --- a/users/riblee/riblee.h +++ b/users/riblee/riblee.h @@ -35,9 +35,7 @@ enum custom_keycodes { COLEMAK, DVORAK, WORKMAN, - BACKLIT, - MAC, - LINUX + BACKLIT }; #define LOWER MO(_LOWER)