mirror of
https://gitlab.com/interception/linux/plugins/caps2esc.git
synced 2025-04-04 22:09:24 +00:00
Passthrough mouse events
To not block mice that have keys, which end up grabbed due to generic configurations that simply filter anything that responds to CAPSLOCK/ESC. Fixes #15
This commit is contained in:
parent
8bfd57eda2
commit
975bb74284
34
caps2esc.c
34
caps2esc.c
@ -46,25 +46,23 @@ void write_event(const struct input_event *event) {
|
||||
}
|
||||
|
||||
void write_event_with_mode(struct input_event *event, int mode) {
|
||||
if (event->type == EV_REL || event->type == EV_ABS)
|
||||
return;
|
||||
|
||||
switch (mode) {
|
||||
case 0:
|
||||
if (event->code == KEY_ESC)
|
||||
event->code = KEY_CAPSLOCK;
|
||||
break;
|
||||
case 2:
|
||||
switch (event->code) {
|
||||
case KEY_ESC:
|
||||
event->code = KEY_GRAVE;
|
||||
break;
|
||||
case KEY_GRAVE:
|
||||
if (event->type == EV_KEY)
|
||||
switch (mode) {
|
||||
case 0:
|
||||
if (event->code == KEY_ESC)
|
||||
event->code = KEY_CAPSLOCK;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch (event->code) {
|
||||
case KEY_ESC:
|
||||
event->code = KEY_GRAVE;
|
||||
break;
|
||||
case KEY_GRAVE:
|
||||
event->code = KEY_CAPSLOCK;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
write_event(event);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user