Alessandro Mauri
21e833143c
changed key names
...
key names now don't include the "KEY_" part before the actual name
4 years ago
Alessandro Mauri
6a5367ac00
verbose option displays key names instead of values
...
very crude implementation, works for standard keys but breaks
for media/special keys, good enough for now
4 years ago
Alessandro Mauri
ea6f548399
added -v argument
...
verbose option: now hkd doesn't default to printing pressed keys basically
acting as a keylogger but now requires -v to do so.
4 years ago
Alessandro Mauri
3ffa960ae7
changed names
...
key_buffer_compare_ordered -> key_buffer_compare
key_buffer_compare_random -> key_buffer_compare_fuzzy
4 years ago
Alessandro Mauri
05a18e8874
implemented exec_command with wordexp(3)
...
this allows for a less error-prone parsing method
(as wordexp(3) is in libc) and enables for shell-like
word expansion, refer to the man page for more info
about wordexp(3)
4 years ago
Alessandro Mauri
d39281f9a6
minor fix
...
hotkeys don't get triggerd twice when after the right
keys are pressed one or more other keys are pressed
afterwards
4 years ago
Alessandro Mauri
ed7202e5c8
added key_buffer_compare_random/ordered
...
In the future one can specify that the hotkey triggers
only when the keys are pressed in the right order, or
in any order, this will be configured per-hotkey in the
config file
4 years ago
Alessandro Mauri
dd319e08b7
deleted empty first line
4 years ago
Alessandro Mauri
8bbdaa3d21
key_buffer is now static for performance
5 years ago
Alessandro Mauri
300b82bc5e
added str_to_argv()
5 years ago
Alessandro Mauri
33526a916f
some linting
5 years ago
Alessandro Mauri
9a5767263e
key conversion table megastruct
5 years ago
Alessandro Mauri
9564915e08
key_buffer_compare()
5 years ago
Alessandro Mauri
edaa6806d4
made std c99 compliant
5 years ago
Alessandro Mauri
b18fb0cf8e
formatting
5 years ago
Alessandro Mauri
129f0ce8e8
commented unnecessary free
5 years ago
Alessandro Mauri
bd3d82158b
minor macro formatting
5 years ago
Alessandro Mauri
d7b0ac68ef
green text
5 years ago
Alessandro Mauri
c4e671b203
close epoll fd on exit
5 years ago
Alessandro Mauri
5acaa2b7df
line savings
5 years ago
Alessandro Mauri
9c89e52692
update on device change with inotify
5 years ago
Alessandro Mauri
a8f8dc8126
removed bsd compatibility
5 years ago
Alessandro Mauri
aaaa94c41d
die() error
5 years ago
Alessandro Mauri
3d84ee6726
converted die to a macro
5 years ago
Alessandro Mauri
db923d7ae0
defines united
5 years ago
Alessandro Mauri
2a236af8a1
saved up some lines with color macros
5 years ago
Alessandro Mauri
cdfed84d5e
redundant message on no devices
5 years ago
Alessandro Mauri
3c9bbe4140
execvp
5 years ago
Alessandro Mauri
038e312941
explicit pointer conversion
...
god I hate linter warnings
5 years ago
Alessandro Mauri
d71e2c98e1
use execv()
...
using execv() instead of execl() allows to more simply run a command
with arguments
5 years ago
Alessandro Mauri
6bd7d36bfc
renamed project to hkd
5 years ago
Alessandro Mauri
296bd3fb79
indented cases and others
5 years ago
Alessandro Mauri
8d890b9e9e
coloured output
5 years ago
Alessandro Mauri
88308249bf
clarified const string
...
cahnged const char *ev_root to const char *evdev_root_dir
to clarufy the role of the variable
5 years ago
Alessandro Mauri
c0400929e4
moved dir scan logic to function
...
moved the logic behind choosing the right file desciptors into a
function allowing for later dynamic update
5 years ago
Alessandro Mauri
636bfe7a5e
reformat and better naming
5 years ago
Alessandro Mauri
58c01fb9d1
generalized die()
...
using fprintf() instead of fputs() to allow string concatenation, die()
now requires a error message which can be NULL and a error message which
will be passed to strerror(), this ensures that errno is fresh when we
use it
5 years ago
Alessandro Mauri
58aceac802
justified exit condition
5 years ago
Alessandro Mauri
922090060f
use switch for fork()
...
save two local variables and improve readability by a bit
5 years ago
Alessandro Mauri
45c52ecf20
removed trailing spaces
5 years ago
Alessandro Mauri
80bacaf775
wait before exit
5 years ago
Alessandro Mauri
678fef9358
fixed various bugs
5 years ago
Alessandro Mauri
f8b8f423f9
filter devices
...
only use devices that can give key events, this should lead to fewer
devices in the poll list and therefore boost performance a bit
5 years ago
Alessandro Mauri
b9bc3138d0
testing command execution
5 years ago
Alessandro Mauri
56024c6a4e
use epoll instead of poll on linux
5 years ago
Alessandro Mauri
1b017733cb
comments
5 years ago
Alessandro Mauri
1f007ab92e
implemented polling for multiple events
...
changelog:
* fixed small (1B) memory leak in pressBufferAdd
* fixed bug where SIGINT would not cause shut down
* implemented polling for every event inside /dev/input
* added more TODOs
5 years ago
Alessandro Mauri
59f8dd9842
before push
5 years ago
Alessandro Mauri
cca522c197
multi event handling prototype
5 years ago
Alessandro Mauri
4f3a2daddf
changed fopen to open
5 years ago