mirror of https://github.com/k0kubun/xremap
Interleave pressing/releasing of modifier keys. (#208)
* Interleave pressing/releasing of modifier keys. Pressing new modifier keys before releasing the old ones to avoid triggering actions in applications that recognize the old keys. For example, if we bind alt+f to ctrl+right, before this change, the following key sequence is generated with alt+f: (user) send Alt_L PRESS (xremap) send Alt_L RELEASE (xremap) send Control_L PRESS (xremap) send Right PRESS (xremap) send Right RELEASE (xremap) send Control_L RELEASE (xremap) send Alt_L PRESS (user) send Alt_L RELEASE The press + release of the alt key (both at the start and end of the sequence) is causing apps like Firefox to show/focus the menu bar. After this change, the following key sequence is generated with alt+f: (user) send Alt_L PRESS (xremap) send Control_L PRESS (xremap) send Alt_L RELEASE (xremap) send Right PRESS (xremap) send Right RELEASE (xremap) send Alt_L PRESS (xremap) send Control_L RELEASE (user) send Alt_L RELEASE So the difference here is that we press the ctrl key before releasing alt, so will not trigger apps like Firefox to show hide the menu when alt+f is used, and a single press and release of the alt key will still show the menu as their normal behavior. As far as I can observe, this is also the behavior of AutoHotKey on Windows. * Add test.pull/209/head
parent
5f97804180
commit
8d3d62559e
Loading…
Reference in New Issue