Commit Graph

68 Commits (master)

Author SHA1 Message Date
Chakib Benziane ac0f4aa3ee
better to send no key for skip event (#462)
I didn't think much about it on my first patch but when skip_key_event
is set the KEY_UNKNOWN is repeated. Better to send no key at all.
4 weeks ago
jixiuf f6b10cebc0
Window matcher for modmap and keymap (wlroots client only) (#447) 2 months ago
Chakib Benziane 45ddd0180c
allow to skip key event on KeyRelease actions (#420) 3 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
jixiuf af4c910773
close https://github.com/k0kubun/xremap/issues/340 (#341) 8 months ago
jixiuf 97b9406c97
modmap held/alone support multi key (#339) 9 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 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
Takashi Kokubun f3f9e53f5a
Flush pending keys with an override remap correctly
Close #154
2 years ago
Kazuyoshi Kato dfe27fe71d
Add keypress_delay_ms to workaround #179 (#191)
Close #179
2 years ago
Takashi Kokubun ed920e5c8d
Resurrect removal of override_remap
broken at 04e94ea9f4
2 years ago
Takashi Kokubun c38f9e9cc6
Dispatch the original key on press/release as well 2 years ago
Takashi Kokubun 9b0c084a5d
Fix a bug in extra_modifiers
```
keymap:
  - remap:
      RO: Shift-RO
```

When you press Shift-RO, Shift is considered extra_modifiers (against
source KeyPress) and it was released after Shift-RO. This patch fixes
that case.
2 years ago
Takashi Kokubun be7d11e244
Keep extra modifiers on KeyPress 2 years ago
Takashi Kokubun c8c4574d0f
Replace modifier: true with virtual_modifiers 2 years ago
Takashi Kokubun 1c508583df
Add a missing word in a comment 2 years ago
Takashi Kokubun 8a3602fa05
Avoid emitting logical modifiers
when adjusting modifiers on KeyPress

addresses https://github.com/k0kubun/xremap/issues/124#issuecomment-1214346914
2 years ago
Takashi Kokubun feb6bfe693
Support logical modifiers 2 years ago
Takashi Kokubun 04e94ea9f4
Make modifier lookup more efficient and flexible
Close #102
2 years ago
Takashi Kokubun ab7cdafb72
Support overriding timeout_key on nested remap 2 years ago
Takashi Kokubun 788624b953
Support executing commands on press/release events 2 years ago
Frederick Zhang 8770711b17
Fix clippy warnings 2 years ago
Frederick Zhang 008fabaf80
Support regex for application names 2 years ago
Takashi Kokubun 2738251657
Support modal remapping 2 years ago
Takashi Kokubun 3494c0a546
Repeat/Release what was originally pressed
Close #87
2 years ago
Takashi Kokubun 2c4e3574e3
Expand modifiers on a nested remap
Fix #91
2 years ago
Takashi Kokubun 140a478e0d
Eagerly expire a timeout prefix 2 years ago
Takashi Kokubun 2adf8f0707
Flush a buffered key on unhandled events 2 years ago
Takashi Kokubun 65f5f27d02
Flush buffered keys on timeout 2 years ago
Takashi Kokubun 0d200a87b2
Add timeout_millis for nested remap 2 years ago
Roland Fredenhagen b3c3c10755
move command line parsing to clap; address clippy 2 years ago
Takashi Kokubun 660084b18b
Support escape_next_key 2 years ago
Takashi Kokubun a311f6fa1e
Do not skip further keys on keymap 2 years ago
Takashi Kokubun c2204a4559
Resolve left and right combinations on deserialization 2 years ago
Takashi Kokubun 343204607c
Reorder set_mark and with_mark 2 years ago
κeen 1974ba57a1
fix typo 2 years ago
Takashi Kokubun c49a9b5cde
Implement mark 2 years ago
Takashi Kokubun 646a1dd53d
Version 0.1.6 2 years ago
Takashi Kokubun 33a3bcee02
Handle child processes with SA_NOCLDWAIT 2 years ago
Takashi Kokubun dc5660754a
Implement launch action 2 years ago
Takashi Kokubun a7e9b92bad
Merge remote-tracking branch 'gdvalle/hotkeys' into launch-action 2 years ago
Takashi Kokubun 16094de2cf
Instantiate Duration on deserialization 2 years ago
Takashi Kokubun 179674e713
Simplify KeyAction deserializer 2 years ago
Greg Dallavalle 225f8019bd Add hotkey command support 2 years ago
Takashi Kokubun 7ab1595836
Rollback to v0.1.5 2 years ago
Takashi Kokubun 320b602789
s/evdev::Key/Key/g again 2 years ago
Takashi Kokubun 3c0fe13c27
Unwrap evdev::Key 2 years ago