added -p flag

This commit is contained in:
mrbesen 2019-01-19 18:12:02 +01:00
parent 033e51201a
commit 1bb82fa267
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
4 changed files with 595 additions and 546 deletions

View File

@ -1,4 +1,4 @@
CXXFLAGS = -Wall -O3 -DSYS_CONF_DIR=\"$(sysconfdir)\"
CXXFLAGS = -std=c++0x -Wall -O3 -DSYS_CONF_DIR=\"$(sysconfdir)\"
bin_PROGRAMS = logkeys llk llkk
logkeys_SOURCES = logkeys.cc
@ -10,4 +10,4 @@ install-exec-hook:
chmod u+s $(DESTDIR)$(bindir)/llk
chown root\: $(DESTDIR)$(bindir)/llkk
chmod u+s $(DESTDIR)$(bindir)/llkk

View File

@ -18,6 +18,7 @@ struct arguments
bool start; // start keylogger, -s switch
bool kill; // stop keylogger, -k switch
bool us_keymap; // use default US keymap, -u switch
bool precise; // log with ms, -p switch
std::string logfile; // user-specified log filename, -o switch
std::string keymap; // user-specified keymap file, -m switch or --export-keymap
std::string device; // user-specified input event device, given with -d switch
@ -48,6 +49,7 @@ void process_command_line_arguments(int argc, char **argv)
{"us-keymap", no_argument, 0, 'u'},
{"kill", no_argument, 0, 'k'},
{"device", required_argument, 0, 'd'},
{"precise", no_argument, 0, 'p'},
{"help", no_argument, 0, '?'},
{"export-keymap", required_argument, &flags, FLAG_EXPORT_KEYMAP},
{"no-func-keys", no_argument, &flags, FLAG_NO_FUNC_KEYS},
@ -62,7 +64,7 @@ void process_command_line_arguments(int argc, char **argv)
int c;
int option_index;
while ((c = getopt_long(argc, argv, "sm:o:ukd:?", long_options, &option_index)) != -1)
while ((c = getopt_long(argc, argv, "sm:o:ukpd:?", long_options, &option_index)) != -1)
{
switch (c)
{
@ -72,6 +74,7 @@ void process_command_line_arguments(int argc, char **argv)
case 'u': args.us_keymap = true; break;
case 'k': args.kill = true; break;
case 'd': args.device = optarg; break;
case 'p': args.precise = true; break;
case 0 :
args.flags |= flags;

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@ void usage()
" -u, --us-keymap use en_US keymap instead of configured default\n"
" -k, --kill kill running logkeys process\n"
" -d, --device=FILE input event device [eventX from " INPUT_EVENT_PATH "]\n"
" -p, --precise add milliseconds to the timestamp and add a timestamp to every press\n"
" -?, --help print this help screen\n"
" --export-keymap=FILE export configured keymap to FILE and exit\n"
" --no-func-keys log only character keys\n"