Commit Graph

11 Commits (master)

Author SHA1 Message Date
jixiuf f6b10cebc0
Window matcher for modmap and keymap (wlroots client only) (#447) 2 months ago
Elliott Shugerman fd3992e486
Support device-specific remapping in config (#380)
* 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
6 months ago
Takashi Kokubun 434a3a79e5 Fix failing tests 8 months ago
jixiuf af4c910773
close https://github.com/k0kubun/xremap/issues/340 (#341) 8 months ago
Perseus 17d50df194
Adds RELATIVE event catcher (#187)
close #180
1 year ago
Lae Chen c10006342c
Merge remaps (#217)
* Allow remaps to be merged.

* Fix formatting.
1 year ago
Lae Chen 14ca00cae3
Introduce keymap level `exact_match` option (#209)
* 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.
2 years ago
Lae Chen 8d3d62559e
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.
2 years ago
Takashi Kokubun 13e6b552d0
Test what actually happens 2 years ago
Takashi Kokubun 04df386833
Test something more meaningful 2 years ago
Takashi Kokubun d02446a040
Split ActionDispatcher from EventHandler (#200)
* 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
2 years ago