For `KEY_XXX` and `KEY_YYY`, use [these names](https://github.com/emberian/evdev/blob/1d020f11b283b0648427a2844b6b980f1a268221/src/scancodes.rs#L26-L572).
For `KEY_XXX` and `KEY_YYY`, use [these names](https://github.com/emberian/evdev/blob/1d020f11b283b0648427a2844b6b980f1a268221/src/scancodes.rs#L26-L572).
You can skip `KEY_` and the name is case-insensitive. So `KEY_CAPSLOCK`, `CAPSLOCK`, and `CapsLock` are the same thing.
You can skip `KEY_` and the name is case-insensitive. So `KEY_CAPSLOCK`, `CAPSLOCK`, and `CapsLock` are the same thing.
Some [custom aliases](src/config/key.rs) like `SHIFT_R`, `CONTROL_L`, etc. are provided.
Some [custom aliases](src/config/key.rs) like `SHIFT_R`, `CONTROL_L`, etc. are provided.
In case you don't know the name of a key, you can find out by enabling the xremap debug output:
```bash
RUST_LOG=debug xremap config.yml
# or
sudo RUST_LOG=debug xremap config.yml
```
Then press the key you want to know the name of.
If you specify a map containing `held` and `alone`, you can use the key for two purposes.
If you specify a map containing `held` and `alone`, you can use the key for two purposes.
The key is considered `alone` if it's pressed and released within `alone_timeout_millis` (default: 1000)
The key is considered `alone` if it's pressed and released within `alone_timeout_millis` (default: 1000)
before any other key is pressed. Otherwise it's considered `held`.
before any other key is pressed. Otherwise it's considered `held`.
The `class` property should be used for application matching, while the `caption` property should be used for window matching.
You want to use the class for the filter.
If you use a systemd-daemon to manage xremap, the prints will be visible in the system-logs (Can be opened with `journalctl -f`)
If you use a systemd-daemon to manage xremap, the prints will be visible in the system-logs (Can be opened with `journalctl -f`)
@ -376,31 +347,6 @@ keymap:
Note how Alt-f and Alt-b work in all apps, but the definition of Alt-f is slightly different in LibreOffice Writer. When that app is active, the first definition overrides the second definition; but for any other app, only the second definition is found. This is because xremap uses the first matching definition that it finds.
Note how Alt-f and Alt-b work in all apps, but the definition of Alt-f is slightly different in LibreOffice Writer. When that app is active, the first definition overrides the second definition; but for any other app, only the second definition is found. This is because xremap uses the first matching definition that it finds.
### device
Much like [`application`](#application), you may specify `{keymap,modmap}.device.{not,only}` in your configuration for device-specific remapping. Consistent with the global `--device` flag, device-matching strings may be any of:
- the full path of the device
- the filename of the device
- the device name
- a substring of the device name
To determine the names and paths of your devices, examine `xremap`'s log output at startup.
```yml
device:
not: '/dev/input/event0'
# or
not: ['event0', ...]
# or
only: 'Some Cool Device Name'
# or
only: ['Cool Device', ...]
# etc...
```
Unlike for `application`, regexs are not supported for `device`.
### virtual\_modifiers
### virtual\_modifiers
You can declare keys that should act like a modifier.
You can declare keys that should act like a modifier.
@ -422,35 +368,6 @@ Some applications have trouble understanding synthesized key events, especially
Wayland. `keypress_delay_ms` can be used to workaround the issue.
Wayland. `keypress_delay_ms` can be used to workaround the issue.
See [#179](https://github.com/k0kubun/xremap/issues/179) for the detail.
See [#179](https://github.com/k0kubun/xremap/issues/179) for the detail.
### Shared data field
You can declare data that does not directly go into the config under the `shared` field.
This can be usefull when using Anchors and Aliases.
For more information about the use of Yaml anchors see the [Yaml specification](https://yaml.org/spec/1.2.2/#3222-anchors-and-aliases).
#### example:
```yaml
shared:
terminals: &terminals # The & Symbol marks this entry as a Anchor
- Gnome-terminal
- Kitty
some_remaps: &some_remaps
Ctrl-f: C-right
Alt-b: C-up
keymap:
- application:
only: *terminals # we can reuse the list here
remap: *some_remaps # and we can reuse a map here.
```
## Maintainers
- @k0kubun
- @N4tus (KDE client)
- @jixiuf (wlroots client)
## License
## License
`xremap` is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
`xremap` is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).