summaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_unicodemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode/process_unicodemap.c')
-rw-r--r--quantum/process_keycode/process_unicodemap.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c
index 195c093e6e..a85568521c 100644
--- a/quantum/process_keycode/process_unicodemap.c
+++ b/quantum/process_keycode/process_unicodemap.c
@@ -15,41 +15,12 @@
*/
#include "process_unicodemap.h"
-#include "unicode.h"
-#include "quantum_keycodes.h"
-#include "keycode.h"
-#include "action_util.h"
-#include "host.h"
-
-__attribute__((weak)) uint16_t unicodemap_index(uint16_t keycode) {
- if (keycode >= QK_UNICODEMAP_PAIR) {
- // Keycode is a pair: extract index based on Shift / Caps Lock state
- uint16_t index;
-
- uint8_t mods = get_mods() | get_weak_mods();
-#ifndef NO_ACTION_ONESHOT
- mods |= get_oneshot_mods();
-#endif
-
- bool shift = mods & MOD_MASK_SHIFT;
- bool caps = host_keyboard_led_state().caps_lock;
- if (shift ^ caps) {
- index = QK_UNICODEMAP_PAIR_GET_SHIFTED_INDEX(keycode);
- } else {
- index = QK_UNICODEMAP_PAIR_GET_UNSHIFTED_INDEX(keycode);
- }
-
- return index;
- } else {
- // Keycode is a regular index
- return QK_UNICODEMAP_GET_INDEX(keycode);
- }
-}
+#include "unicodemap.h"
+#include "keycodes.h"
bool process_unicodemap(uint16_t keycode, keyrecord_t *record) {
if (keycode >= QK_UNICODEMAP && keycode <= QK_UNICODEMAP_PAIR_MAX && record->event.pressed) {
- uint32_t code_point = pgm_read_dword(unicode_map + unicodemap_index(keycode));
- register_unicode(code_point);
+ register_unicodemap(unicodemap_index(keycode));
}
return true;
}