I'm writing a simple GTK3 application and I need to detect, that SHIFT key is pressed during while application is loading.
I want to quit as early as possible, if SHIFT is not pressed. So I have no application window at this point
How can I query global keyboard state from GTK/GDK?
I tried to use gdk_seat_get_keyboard
+ gdk_window_get_device_position
, but I get gdk_window_get_device_position_double: assertion 'gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD' failed
in console. It also requires to have an application window.
I'm ok with code sample in any language (C, Vala, Python preferred)