diff --git a/xkeymap.c b/xkeymap.c index 231e50b..c5c2224 100644 --- a/xkeymap.c +++ b/xkeymap.c @@ -393,9 +393,12 @@ ensure_remote_modifiers(uint32 ev_time, key_translation tr) static void update_modifier_state(uint16 modifiers, BOOL pressed) { +#ifdef WITH_DEBUG_KBD + uint16 old_modifier_state; + + old_modifier_state = remote_modifier_state; +#endif - DEBUG_KBD(("Before updating modifier_state:0x%x, pressed=0x%x\n", - remote_modifier_state, pressed)); switch (modifiers) { case SCANCODE_CHAR_LSHIFT: @@ -436,7 +439,15 @@ update_modifier_state(uint16 modifiers, BOOL pressed) } break; } - DEBUG_KBD(("After updating modifier_state:0x%x\n", remote_modifier_state)); + +#ifdef WITH_DEBUG_KBD + if (old_modifier_state != remote_modifier_state) + { + DEBUG_KBD(("Before updating modifier_state:0x%x, pressed=0x%x\n", + old_modifier_state, pressed)); + DEBUG_KBD(("After updating modifier_state:0x%x\n", remote_modifier_state)); + } +#endif }