Update keycodes

This commit is contained in:
Drashna Jaelre 2018-11-02 10:09:45 -07:00
parent be2c6e70a7
commit 5015c2b4d2
No known key found for this signature in database
GPG Key ID: 4C4221222CD5F9F0
2 changed files with 17 additions and 10 deletions

View File

@ -147,31 +147,31 @@ void send_unicode_hex_string(const char *str) {
bool process_record_unicode_common(uint16_t keycode, keyrecord_t *record) { bool process_record_unicode_common(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {
switch (keycode) { switch (keycode) {
case UNI_OSX: case UNICODE_MODE_OSX:
set_unicode_input_mode(UC_OSX); set_unicode_input_mode(UC_OSX);
#if defined(AUDIO_ENABLE) && defined(UNICODE_OSX_SONG) #if defined(AUDIO_ENABLE) && defined(UNICODE_OSX_SONG)
PLAY_SONG(UNICODE_OSX_SONG); PLAY_SONG(UNICODE_OSX_SONG);
#endif #endif
break; break;
case UNI_LINUX: case UNICODE_MODE_LINUX:
set_unicode_input_mode(UC_LNX); set_unicode_input_mode(UC_LNX);
#if defined(AUDIO_ENABLE) && defined(UNICODE_LINUX_SONG) #if defined(AUDIO_ENABLE) && defined(UNICODE_LINUX_SONG)
PLAY_SONG(UNICODE_LINUX_SONG); PLAY_SONG(UNICODE_LINUX_SONG);
#endif #endif
break; break;
case UNI_WIN: case UNICODE_MODE_WINDOWS:
set_unicode_input_mode(UC_WIN); set_unicode_input_mode(UC_WIN);
#if defined(AUDIO_ENABLE) && defined(UNICODE_WINDOWS_SONG) #if defined(AUDIO_ENABLE) && defined(UNICODE_WINDOWS_SONG)
PLAY_SONG(UNICODE_WINDOWS_SONG); PLAY_SONG(UNICODE_WINDOWS_SONG);
#endif #endif
break; break;
case UNI_WINC: case UNICODE_MODE_WIN_COMPOSE:
set_unicode_input_mode(UC_WINC); set_unicode_input_mode(UC_WINC);
#if defined(AUDIO_ENABLE) && defined(UNICODE_WIN_COMPOSE_SONG) #if defined(AUDIO_ENABLE) && defined(UNICODE_WIN_COMPOSE_SONG)
PLAY_SONG(UNICODE_WIN_COMPOSE_SONG); PLAY_SONG(UNICODE_WIN_COMPOSE_SONG);
#endif #endif
break; break;
case UNI_OSX_RALT: case UNICODE_MODE_OSX_RALT:
set_unicode_input_mode(UC_OSX_RALT); set_unicode_input_mode(UC_OSX_RALT);
#if defined(AUDIO_ENABLE) && defined(UNICODE_OSX_RALT_SONG) #if defined(AUDIO_ENABLE) && defined(UNICODE_OSX_RALT_SONG)
PLAY_SONG(UNICODE_OSX_RALT_SONG); PLAY_SONG(UNICODE_OSX_RALT_SONG);

View File

@ -453,11 +453,12 @@ enum quantum_keycodes {
TERM_ON, TERM_ON,
TERM_OFF, TERM_OFF,
#endif #endif
UNI_OSX, UNICODE_MODE_OSX,
UNI_LINUX, UNICODE_MODE_LINUX,
UNI_WIN, UNICODE_MODE_WINDOWS,
UNI_WINC, UNICODE_MODE_WIN_COMPOSE,
UNI_OSX_RALT, UNICODE_MODE_OSX_RALT,
// always leave at the end // always leave at the end
SAFE_RANGE SAFE_RANGE
}; };
@ -685,6 +686,12 @@ enum quantum_keycodes {
#define X(n) (QK_UNICODE_MAP | (n)) #define X(n) (QK_UNICODE_MAP | (n))
#endif #endif
#define UC_M_OS UNICODE_MODE_OSX
#define UC_M_LN UNICODE_MODE_LINUX
#define UC_M_WI UNICODE_MODE_WINDOWS
#define UC_M_WC UNICODE_MODE_WINCOMPOSE
#define UC_M_OR UNICODE_MODE_OSX_RALT
#ifdef SWAP_HANDS_ENABLE #ifdef SWAP_HANDS_ENABLE
#define SH_T(kc) (QK_SWAP_HANDS | (kc)) #define SH_T(kc) (QK_SWAP_HANDS | (kc))
#define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE) #define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE)