linput

Listen to input events
git clone git://git.akobets.xyz/linput
Log | Files | Refs | README | LICENSE

commit 5e0818b59564697bbbbc5a2b9cb19bb937aeb168
parent 6bd91356baf4f8edee0d0e0a33609b45eb8129ef
Author: Artem Kobets <artem@akobets.xyz>
Date:   Sun, 19 Apr 2020 17:19:13 +0300

docs

Diffstat:
MREADME | 12++++++------
Mconfig.def.h | 33++++++++++++++-------------------
Mlinput.1 | 12++++++------
3 files changed, 26 insertions(+), 31 deletions(-)

diff --git a/README b/README @@ -1,14 +1,14 @@ -linput \- listen to input events +linput - listen to input events linput is an input event listener that runs a given command when a rule is matched. -It reads input data from /dev/input/event* files. +It reads input data from device files (/dev/input/event*). -Two types of rules can be specified: events and hotkeys. +Two types of rules can be configured: events and hotkeys. -Events are simple rules that can match any input event. +Events are simple rules that match a single input event. -Hotkeys are rules specifically for keyboard events. -You can specify a modifier mask (Ctrl, Alt, etc.), +Hotkeys are rules for keyboard events. +They consist of a modifier mask (Ctrl, Alt, etc.), a list of regular keys, and an event mask (trigger on press, release or hold). linput is customized through editing config.h file and recompiling source code. diff --git a/config.def.h b/config.def.h @@ -19,24 +19,19 @@ static struct EventRule { }; enum { - /* any modifiers */ - MOD_ANY = 0x0001, - MOD_LEFTSHIFT = 0x0002, - MOD_RIGHTSHIFT = 0x0004, - /* left or right shift */ - MOD_SHIFT = 0x0008, - MOD_LEFTCTRL = 0x0010, - MOD_RIGHTCTRL = 0x0020, - /* left or right ctrl */ - MOD_CTRL = 0x0040, - MOD_LEFTSUPER = 0x0080, - MOD_RIGHTSUPER = 0x0100, - /* left or right super */ - MOD_SUPER = 0x0200, - MOD_LEFTALT = 0x0400, - MOD_RIGHTALT = 0x0800, - /* left or right alt */ - MOD_ALT = 0x1000 + MOD_ANY = 0x0001, /* any modifiers */ + MOD_SHIFT = 0x0002, /* left or right shift */ + MOD_LEFTSHIFT = 0x0004, + MOD_RIGHTSHIFT = 0x0008, + MOD_CTRL = 0x0010, /* left or right ctrl */ + MOD_LEFTCTRL = 0x0020, + MOD_RIGHTCTRL = 0x0040, + MOD_SUPER = 0x0080, /* left or right super */ + MOD_LEFTSUPER = 0x0100, + MOD_RIGHTSUPER = 0x0200, + MOD_ALT = 0x0400, /* left or right alt */ + MOD_LEFTALT = 0x0080, + MOD_RIGHTALT = 0x1000 } HotkeyMod; enum { @@ -45,7 +40,7 @@ enum { ON_HOLD = 0x04 } HotkeyEvent; -#define HOTKEY_MAX_KEYS 20 +#define HOTKEY_MAX_KEYS 10 static struct HotkeyRule { char **cmd; diff --git a/linput.1 b/linput.1 @@ -7,19 +7,19 @@ linput \- listen to input events .SH DESCRIPTION .B linput is an input event listener that runs a given command when a rule is matched. -It reads input data from /dev/input/event* files. +It reads input data from device files (/dev/input/event*). -Two types of rules can be specified: +Two types of rules can be configured: .B events and -.B hotkeys +.B hotkeys. .B Events -are simple rules that can match any input event. +are simple rules that match a single input event. .B Hotkeys -are rules specifically for keyboard events. -You can specify a modifier mask (Ctrl, Alt, etc.), +are rules for keyboard events. +They consist of a modifier mask (Ctrl, Alt, etc.), a list of regular keys, and an event mask (trigger on press, release or hold). linput is customized through editing config.h file and recompiling source code.