From 4e9170156ee83217a1379b2cae051de268831f38 Mon Sep 17 00:00:00 2001 From: tmk Date: Wed, 9 Dec 2015 12:03:07 +0900 Subject: [PATCH] Updated FAQ Keymap (markdown) --- FAQ-Keymap.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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