summaryrefslogtreecommitdiffstats
path: root/FAQ-Keymap.md
diff options
context:
space:
mode:
authortmk <tmk@users.noreply.github.com>2015-12-09 12:03:07 +0900
committertmk <tmk@users.noreply.github.com>2015-12-09 12:03:07 +0900
commit4e9170156ee83217a1379b2cae051de268831f38 (patch)
tree6d1e15b714d4fb27d2e6716c521dc5872b0ca24b /FAQ-Keymap.md
parentfbbf8b501f151a4f69a34220ce388b603b213cce (diff)
Updated FAQ Keymap (markdown)
Diffstat (limited to 'FAQ-Keymap.md')
-rw-r--r--FAQ-Keymap.md27
1 files changed, 26 insertions, 1 deletions
diff --git a/FAQ-Keymap.md b/FAQ-Keymap.md
index c38641eb07..e6f01f53c0 100644
--- a/FAQ-Keymap.md
+++ b/FAQ-Keymap.md
@@ -221,4 +221,29 @@ Dual-role key: https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys
`EJCT` keycode works on OSX. https://github.com/tmk/tmk_keyboard/issues/250
It seems Windows 10 ignores the code and Linux/Xorg recognizes but has no mapping by default.
-Not sure what keycode Eject is on genuine Apple keyboard actually. HHKB uses `F20` for Eject key(`Fn+f`) on Mac mode but this is not same as Apple Eject keycode probably. \ No newline at end of file
+Not sure what keycode Eject is on genuine Apple keyboard actually. HHKB uses `F20` for Eject key(`Fn+f`) on Mac mode but this is not same as Apple Eject keycode probably.
+
+
+
+## What's weak_mods and real_mods in action_util.c
+___TO BE IMPROVED___
+
+real_mods is intended to retains state of real/physical modifier key state, while
+weak_mods retains state of virtual or temprary modifiers which should not affect state real modifier key.
+
+Let's say you hold down physical left shift key and type ACTION_MODS_KEY(LSHIFT, KC_A),
+
+with weak_mods,
+(1) hold down left shift: real_mods |= MOD_BIT(LSHIFT)
+(2) press ACTION_MODS_KEY(LSHIFT, KC_A): weak_mods |= MOD_BIT(LSHIFT)
+(3) release ACTION_MODS_KEY(LSHIFT, KC_A): waek_mods &= ~MOD_BIT(LSHIFT)
+real_mods still keeps modifier state.
+
+without weak mods,
+(1) hold down left shift: real_mods |= MOD_BIT(LSHIFT)
+(2) press ACTION_MODS_KEY(LSHIFT, KC_A): real_mods |= MOD_BIT(LSHIFT)
+(3) release ACTION_MODS_KEY(LSHIFT, KC_A): real_mods &= ~MOD_BIT(LSHIFT)
+here real_mods lost state for 'physical left shift'.
+
+weak_mods is ORed with real_mods when keyboard report is sent.
+https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/action_util.c#L57