1
0
Fork 0

Normalise Unicode keycodes (#18898)

* `UC_MOD`/`UC_RMOD` -> `UC_NEXT`/`UC_PREV`

* `UNICODE_MODE_*` -> `QK_UNICODE_MODE_*`

* `UC_MAC` -> `UNICODE_MODE_MACOS`

* `UC_LNX` -> `UNICODE_MODE_LINUX`

* `UC_WIN` -> `UNICODE_MODE_WINDOWS`

* `UC_BSD` -> `UNICODE_MODE_BSD`

* `UC_WINC` -> `UNICODE_MODE_WINCOMPOSE`

* `UC_EMACS` -> `UNICODE_MODE_EMACS`

* `UC__COUNT` -> `UNICODE_MODE_COUNT`

* `UC_M_MA` -> `UC_MAC`

* `UC_M_LN` -> `UC_LINX`

* `UC_M_WI` -> `UC_WIN`

* `UC_M_BS` -> `UC_BSD`

* `UC_M_WC` -> `UC_WINC`

* `UC_M_EM` -> `UC_EMAC`

* Docs

* Update quantum/unicode/unicode.h
This commit is contained in:
Ryan 2022-11-01 08:15:12 +11:00 committed by GitHub
parent 743524df32
commit 5974d989fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
132 changed files with 303 additions and 292 deletions

View file

@ -31,7 +31,7 @@
#endif
#define UNICODE_SELECTED_MODES UC_MAC, UC_LNX, UC_WINC, UC_EMACS
#define UNICODE_SELECTED_MODES UNICODE_MODE_MACOS, UNICODE_MODE_LINUX, UNICODE_MODE_WINCOMPOSE, UNICODE_MODE_EMACS
#define SPI_DEBUG_SCAN_RATE

View file

@ -61,9 +61,9 @@ const rgblight_segment_t PROGMEM _huh_layer[] = RGBLIGHT_LAYER_SEGMENTS(CORNE
#define UNICODE_OFFSET 12
const rgblight_segment_t PROGMEM _uc_mac_layer[] = RGBLIGHT_LAYER_SEGMENTS(CORNER_BR(HSV_PURPLE));
// No indicator for UC_LNX
// UC_WIN disabled in config.h
// UC_BSD not implemented
// No indicator for UNICODE_MODE_LINUX
// UNICODE_MODE_WINDOWS disabled in config.h
// UNICODE_MODE_BSD not implemented
const rgblight_segment_t PROGMEM _uc_winc_layer[] = RGBLIGHT_LAYER_SEGMENTS(CORNER_BR(HSV_CYAN));
const rgblight_segment_t PROGMEM _uc_emacs_layer[] = RGBLIGHT_LAYER_SEGMENTS(CORNER_BR(HSV_GREEN));
@ -85,14 +85,14 @@ const rgblight_segment_t *const PROGMEM _rgb_layers[] = {
[ACK_OFFSET + ACK_MEH] = _meh_layer,
[ACK_OFFSET + ACK_HUH] = _huh_layer,
[UNICODE_OFFSET + UC_MAC] = _uc_mac_layer,
[UNICODE_OFFSET + UC_LNX] = _none,
[UNICODE_OFFSET + UC_WIN] = _none,
[UNICODE_OFFSET + UC_BSD] = _none,
[UNICODE_OFFSET + UC_WINC] = _uc_winc_layer,
[UNICODE_OFFSET + UC_EMACS] = _uc_emacs_layer,
[UNICODE_OFFSET + UNICODE_MODE_MACOS] = _uc_mac_layer,
[UNICODE_OFFSET + UNICODE_MODE_LINUX] = _none,
[UNICODE_OFFSET + UNICODE_MODE_WINDOWS] = _none,
[UNICODE_OFFSET + UNICODE_MODE_BSD] = _none,
[UNICODE_OFFSET + UNICODE_MODE_WINCOMPOSE] = _uc_winc_layer,
[UNICODE_OFFSET + UNICODE_MODE_EMACS] = _uc_emacs_layer,
[UNICODE_OFFSET + UC__COUNT] = NULL
[UNICODE_OFFSET + UNICODE_MODE_COUNT] = NULL
};
// clang-format on
@ -113,7 +113,7 @@ void do_rgb_layers(layer_state_t state, uint8_t start, uint8_t end) {
}
void do_rgb_unicode(uint8_t uc_mode) {
for (uint8_t i = 0; i < UC__COUNT; i++) {
for (uint8_t i = 0; i < UNICODE_MODE_COUNT; i++) {
bool is_on = i == uc_mode;
rgblight_set_layer_state(UNICODE_OFFSET + i, is_on);
}

View file

@ -224,7 +224,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
// to determine what Print Screen key should do. The
// idea here is to make it consistent across hosts.
switch (get_unicode_input_mode()) {
case UC_MAC:
case UNICODE_MODE_MACOS:
if ((mods | osm) & MOD_MASK_ALT) {
// Window screenshot
clear_mods();
@ -247,8 +247,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
break;
case UC_WIN:
case UC_WINC:
case UNICODE_MODE_WINDOWS
case UNICODE_MODE_WINCOMPOSE:
if ((mods | osm) & MOD_MASK_ALT) {
// Window screenshot
// Alt+PrintScreen should work as is

View file

@ -24,5 +24,5 @@ const uint32_t PROGMEM unicode_map[] = {
void eeconfig_init_user_unicode(void) {
// Default to Linux style
set_unicode_input_mode(UC_LNX);
set_unicode_input_mode(UNICODE_MODE_LINUX);
}