* begin threading InputDevice down to `find_modmap`/`find_keymap`
why did i comment this out?
* add to config
* new approach for event/device (wip)
* try passing input_device as its own thing -- same problem
* aha! this works!
* this works too!
* start wiring it together
* that might do it?
* fallback to false, like for application
* fix device.not
* tests (wip)
* tests (wip) | well it compiles
* tests (wip) | just placeholder for now
* move device out of event
* Revert "move device out of event"
This reverts commit c9486ed2adee5f001ebf96d630621fabcb2127a5.
* device desc struct (k0kubun's suggestion)
* get tests passing
* s/InputDeviceDescriptor/InputDeviceInfo/
* add a test
* misc cleanup
* use &str and &Path instead of String and PathBuf
* cargo fmt
* move InputDeviceInfo in device.rs
* more misc cleanup
* documentation
* get rid of extraneous `matches` function
* readme tweak
* Introduce keymap level `exact_match` option.
Example:
keymap:
- exact_match: true
remap:
M-f: C-right
Given the above, and M-Shift-f is pressed:
- If `exact_match` is false or unset, the existing behaviour will be used,
which will translate M-Shift-f to C-Shift-right.
- If `exact_match` is true, M-Shift-f will be sent as is, i.e. not matched.
* Perform exact match first.
* 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.
* Introduce Event enum
* Rename KeyAction/Action to ModmapAction/KeymapAction
* Introduce Action enum and ActionDispatcher
* Convert OverrideTimeout to an event
* thread::sleep should also be an Action
* Command should also be an Action
* Make InputEvent an Action
* Start writing tests for EventHandler
* cargo fmt