Hi all, I’m trying to write a little program in which I would like to run a function every time the Caps Lock function is pressed. For that I was attempting to write something like the below code using GdkKeymap and connecting to its signals to smoothly wait for the key-pressed event:
However I get a “GLib-GObject-WARNING **: g_object_connect: invalid signal spec “Gdk.Keymap::state-changed”” error. I’ve read the docs 1 and I failed to understand how am I supposed to specify the keymap “state-changed” signal 2. Does anybody how it is done? Or am I completely off-point and should be doing something completely different?
Please, don’t use g_object_connect() to connect to a single signal: it’s a “magic” C convenience function that only makes sense in the context of creating a new object instance, connecting to a bunch of signals, and setting a bunch of properties, all at the same time.