Suspend Lua execution while waiting for a result from the callback.

It doesn't suspend, keygrab() just sleep loops here and seems to use the global variable km to communicate between the callback from the widget filter (X11 or Windows version of) keygrab_cb().

What I'm suggesting is that it be rewritten to not use window filters but to replace this with a call to g_signal_connect similar to keybindings.c in Geany itself.

It will require rewriting the signal handler since the returned event data is different to either existing one, but its the same for all platforms so its portable. Also Glib/GTK does the keymap crap before it returns the event, so all that can be deleted, yay less code.

Since it seems to work for those who use it, the sleep loop approach can probably be kept no matter how smelly it is 👃

What are the use cases for geany.keygrab?

Just because neither you nor I am smart enough to figure a use-case immediately doesn't mean someone else hasn't, the function has been there for a long time (at least since 2009 when the plugin was moved to geany-plugins), so no it can't be removed.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany-plugins/issues/1230/1454943556@github.com>