Commit Graph

206 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.
2 weeks ago
N4tus e54fc8ac4a
KDE: Add support for window matching. (#448)
KDE: Add support for window matching.
2 months ago
jixiuf f6b10cebc0
Window matcher for modmap and keymap (wlroots client only) (#447) 2 months ago
N4tus 93a17a042f Handle new KWin API for kde-backend. 2 months ago
Chakib Benziane 45ddd0180c
allow to skip key event on KeyRelease actions (#420) 3 months ago
mattamend 3f1c85def6
Add TOML support to xremap (#404)
* Add TOML support to load_configs()

* Add TOML tests to config/tests.rs

* Add TOML to Cargo.toml

* Move toml tests in src/config/tests.rs to below yaml tests

* Add filename extension checker to config parser

---------

Co-authored-by: Matt Amend <matt.a.amend@gmail.com>
4 months ago
Pieter f2c4eb3e5d
Added shared data field and tests (#402)
* added shared data field and tests

* updated readme
5 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 be51386e42 Revert "Revert "Version 0.8.11""
This reverts commit c063d065c3.
7 months ago
Takashi Kokubun 434a3a79e5 Fix failing tests 7 months ago
Takashi Kokubun c063d065c3 Revert "Version 0.8.11"
This reverts commit c72d9b67f0.

Revert "Use xremap as the device name by default (#348)"

This reverts commit 26c90bb2b5.

Revert "Version 0.8.10"

This reverts commit d5ccb8c917.
7 months ago
Takashi Kokubun 26c90bb2b5
Use xremap as the device name by default (#348) 8 months ago
Takashi Kokubun f0bd2d5e3c Add REL_WHEEL and REL_HWHEEL if --mouse
Close #260
8 months ago
Alex Sinitsin 383e2a4a57
Initial implementation for wlroots client (#345)
Co-authored-by: Alex Sinitsin <meowcoder@users.noreply.github.com>
8 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) 8 months ago
Takashi Kokubun bdb9d0522d Use derived possible values
I don't see any issues in v4.
10 months ago
Takashi Kokubun 01f8428775 cargo fmt 10 months ago
Takashi Kokubun e11d4cda7c Migrate to clap 4 10 months ago
Ching Chang bec3ce9bd5
handle multiple config files (#269)
* handle multiple config files

* shorter variable name

* run formatter

* extend virtual modifiers too
1 year ago
N4tus 84ea31f09e
Kde wayland (#264)
* First implementation of kde client

* load kwin-script via dbus interface on startup, if not already present

* remove temp file after use

* fix wrong object path

* fix wrong load_script return type

* log important information

* try to unload plugin if loading fails.

* change info to println, since it should always be printed

* remove unnecessary mut

* extend README.md

* extend build.yml to build, test, and publish the kde version

* improve README.md
1 year ago
Takashi Kokubun 2603e89999 Remove REL_WHEEL and REL_HWHEEL
as a workaround for Arch Linux with systemd-253-1.

Close #246
1 year ago
Yavor Kolev e75c0bae09
Update Hyprland-rs to `0.3.0` (#247)
* Update Hyprland-rs

* Remove needless serialize and deserializing

* Remove needless conversion of string
1 year ago
Perseus 17d50df194
Adds RELATIVE event catcher (#187)
close #180
1 year ago
Zai-Chun Chen 3d55149056
fix: application None check when failed get the application name (#220)
* fix: application None check when failed get the application name

* Update src/client/hypr_client.rs

Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
1 year ago
Lae Chen c10006342c
Merge remaps (#217)
* Allow remaps to be merged.

* Fix formatting.
1 year ago
Zai-Chun Chen e292e344b4
Feature hyprland (#216)
* init support for hyprland with hyprland-rs

* enable ci for feature* branches

* cargo fmt the code
1 year ago
Kai Xia(夏恺) 9f5002ee1b
Ensure the launched commands are not terminated by the stop of xremap. (#214)
* Ensure the launched commands are not terminated by the stop of xremap.

Fix #213.

Signed-off-by: Kai Xia <kaix+github@fastmail.com>

* also stop child processes on unhappy path.

Signed-off-by: Kai Xia <kaix+github@fastmail.com>

* fix fmt

Signed-off-by: Kai Xia <kaix+github@fastmail.com>

Signed-off-by: Kai Xia <kaix+github@fastmail.com>
1 year ago
Lae Chen a759d5b516
Reconnect to X11 when existing connection stops working. (#212) 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.
1 year 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.
1 year 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
Roland Fredenhagen c2f8d5d468
fix: libinput dwt support (#196) 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 b284c51c86
Check Focus-Proxy-Window.FocusProxy
close #151
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 a448a24ec8
Make it possible to match a full WM_CLASS in X11
Close #107
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