mirror of
https://gitlab.com/interception/linux/plugins/caps2esc.git
synced 2025-07-07 11:28:50 +00:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
975bb74284 | |||
8bfd57eda2 | |||
186b887e7d | |||
c738e8783a | |||
a062311ffb | |||
ac6bbe61c2 | |||
12dc2f75c7 | |||
3eaf2bddfe |
18
README.md
18
README.md
@ -67,29 +67,28 @@ options:
|
|||||||
For more information about the [_Interception Tools_][interception-tools], check
|
For more information about the [_Interception Tools_][interception-tools], check
|
||||||
the project's website.
|
the project's website.
|
||||||
|
|
||||||
## Mouse button support
|
## Mouse Support
|
||||||
|
|
||||||
After _Interception Tools_ 0.3, `caps2esc` can work with mouse clicks. An
|
After _Interception Tools_ 0.3.1, `caps2esc` can observe for mouse events. An
|
||||||
example configuration taken from my laptop:
|
example configuration taken from my laptop:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
SHELL: [zsh, -c]
|
SHELL: [zsh, -c]
|
||||||
---
|
---
|
||||||
- JOB: mux -c caps2esc
|
- JOB: >
|
||||||
- JOB:
|
mux -c caps2esc;
|
||||||
- intercept -g $DEVNODE | mux -o caps2esc
|
mux -i caps2esc | caps2esc | uinput -d /dev/input/by-path/platform-i8042-serio-0-event-kbd
|
||||||
- mux -i caps2esc | caps2esc | uinput -d $DEVNODE
|
- JOB: intercept -g $DEVNODE | mux -o caps2esc
|
||||||
DEVICE:
|
DEVICE:
|
||||||
LINK: /dev/input/by-path/platform-i8042-serio-0-event-kbd
|
LINK: /dev/input/by-path/platform-i8042-serio-0-event-kbd
|
||||||
- JOB:
|
- JOB: intercept $DEVNODE | mux -o caps2esc
|
||||||
- intercept $DEVNODE | mux -o caps2esc
|
|
||||||
DEVICE:
|
DEVICE:
|
||||||
LINK: /dev/input/by-path/platform-i8042-serio-4-event-mouse
|
LINK: /dev/input/by-path/platform-i8042-serio-4-event-mouse
|
||||||
```
|
```
|
||||||
|
|
||||||
For more information on the topic, check the [_Interception Tools_
|
For more information on the topic, check the [_Interception Tools_
|
||||||
README][interception-tools] about usage of the `mux` tool and device specific
|
README][interception-tools] about usage of the `mux` tool and device specific
|
||||||
setups.
|
setups, and [this discussion][issue-9-note] for more examples.
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@ -156,4 +155,5 @@ Copyright © 2017 Francisco Lopes da Silva
|
|||||||
[x]: https://www.x.org
|
[x]: https://www.x.org
|
||||||
[interception]: https://github.com/oblitum/Interception
|
[interception]: https://github.com/oblitum/Interception
|
||||||
[interception-tools]: https://gitlab.com/interception/linux/tools
|
[interception-tools]: https://gitlab.com/interception/linux/tools
|
||||||
|
[issue-9-note]: https://gitlab.com/interception/linux/plugins/caps2esc/-/issues/9#note_474942893
|
||||||
[key-repeat-fix]: https://github.com/oblitum/caps2esc/issues/1
|
[key-repeat-fix]: https://github.com/oblitum/caps2esc/issues/1
|
||||||
|
@ -46,9 +46,7 @@ void write_event(const struct input_event *event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void write_event_with_mode(struct input_event *event, int mode) {
|
void write_event_with_mode(struct input_event *event, int mode) {
|
||||||
if (event->type == EV_REL || event->type == EV_ABS)
|
if (event->type == EV_KEY)
|
||||||
return;
|
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 0:
|
case 0:
|
||||||
if (event->code == KEY_ESC)
|
if (event->code == KEY_ESC)
|
||||||
@ -69,8 +67,8 @@ void write_event_with_mode(struct input_event *event, int mode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
int opt, mode = 0, delay = 20000;
|
int mode = 0, delay = 20000;
|
||||||
while ((opt = getopt(argc, argv, "ht:m:")) != -1) {
|
for (int opt; (opt = getopt(argc, argv, "ht:m:")) != -1;) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'h':
|
case 'h':
|
||||||
return print_usage(stdout, argv[0]), EXIT_SUCCESS;
|
return print_usage(stdout, argv[0]), EXIT_SUCCESS;
|
||||||
|
Reference in New Issue
Block a user