summaryrefslogtreecommitdiff
path: root/quantum/keymap_common.c
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-08-25 01:16:59 +0100
committerGitHub <noreply@github.com>2021-08-25 01:16:59 +0100
commita84de5e22be25e2059dfee732f5cca3ec0953a35 (patch)
tree31202fc9dcf0ff56ead905b234ed0ab364ca7de7 /quantum/keymap_common.c
parent3855713ca0a9513c51fe70e61032d7ea89fa7e87 (diff)
Revert 14083 && 14144 (#14150)
* Revert "Short term bodge for firmware size bloat (#14144)" This reverts commit a8d65473461c337fb1e168d907bfb8c3ac8fdbd0. * Revert "Tidy up quantum.c now some of tmk_core has been merged (#14083)" This reverts commit c4dbf4bf0118dd785802861beb247433b5b7411d.
Diffstat (limited to 'quantum/keymap_common.c')
-rw-r--r--quantum/keymap_common.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c
index 008177bbee..780c71ab9b 100644
--- a/quantum/keymap_common.c
+++ b/quantum/keymap_common.c
@@ -36,31 +36,6 @@ extern keymap_config_t keymap_config;
36 36
37#include <inttypes.h> 37#include <inttypes.h>
38 38
39uint8_t extract_mod_bits(uint16_t code) {
40 switch (code) {
41 case QK_MODS ... QK_MODS_MAX:
42 break;
43 default:
44 return 0;
45 }
46
47 uint8_t mods_to_send = 0;
48
49 if (code & QK_RMODS_MIN) { // Right mod flag is set
50 if (code & QK_LCTL) mods_to_send |= MOD_BIT(KC_RCTL);
51 if (code & QK_LSFT) mods_to_send |= MOD_BIT(KC_RSFT);
52 if (code & QK_LALT) mods_to_send |= MOD_BIT(KC_RALT);
53 if (code & QK_LGUI) mods_to_send |= MOD_BIT(KC_RGUI);
54 } else {
55 if (code & QK_LCTL) mods_to_send |= MOD_BIT(KC_LCTL);
56 if (code & QK_LSFT) mods_to_send |= MOD_BIT(KC_LSFT);
57 if (code & QK_LALT) mods_to_send |= MOD_BIT(KC_LALT);
58 if (code & QK_LGUI) mods_to_send |= MOD_BIT(KC_LGUI);
59 }
60
61 return mods_to_send;
62}
63
64/* converts key to action */ 39/* converts key to action */
65action_t action_for_key(uint8_t layer, keypos_t key) { 40action_t action_for_key(uint8_t layer, keypos_t key) {
66 // 16bit keycodes - important 41 // 16bit keycodes - important