From e822c04146508e76f7bdeff30365d9859fe87f72 Mon Sep 17 00:00:00 2001 From: Gregor Best Date: Sun, 24 Aug 2025 14:55:21 +0200 Subject: [PATCH] fix output of `--dump` when modifiers are present Modifiers need to be printed after the key, not in front of it. This changes output of the form # KEY_LEFTMETA+KEY_EJECTCD 1 command to # KEY_EJECTCD+KEY_LEFTMETA 1 command which matches the way keys are matched in the trigger files. --- thd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thd.c b/thd.c index d42a692..f2d4457 100644 --- a/thd.c +++ b/thd.c @@ -92,7 +92,7 @@ static void print_triggerline(struct input_event ev, keystate_holder ksh) { char *state = ( ev.type == EV_KEY ? get_keystate_ignore_key( ksh, ev.code ) : NULL); const int d = (state && strlen(state)>0); if ( evname != NULL ) { - printf( "# %s%s%s\t%d\tcommand\n", state?state:"", d?"+":"", evname, ev.value ); + printf( "# %s%s%s\t%d\tcommand\n", evname, d?"+":"", state?state:"", ev.value ); fflush(stdout); } free(state);