how to catch keystroke in clipman menu?

Sylvain Viart sylvain at opensource-expert.com
Thu Sep 2 08:20:57 CEST 2021


Hi,

I would like to add 2 new key binding in clipman menu, in order to swap 
Secure Item as Clear Text, and also to delete any them directly from 
menu hitting del key.

image.png

I lack gtk knowledge, what I found is that:

the app seems to do a g_application_register

https://docs.gtk.org/gio/method.Application.register.html 
<https://docs.gtk.org/gio/method.Application.register.html>

but, I think the sole purpose of this is to avoid duplicate running clipman.

I also found, that I should add a keyboard mask somewhere GDK_KEY_PRESS_MASK

https://stackoverflow.com/questions/44098084/how-do-i-handle-keyboard-events-in-gtk3 
<https://stackoverflow.com/questions/44098084/how-do-i-handle-keyboard-events-in-gtk3>

may be their in panel_plugin_register() ?

https://gitlab.xfce.org/Sylvain/xfce4-clipman-plugin/-/blob/secure_item_dbus/panel-plugin/main-panel-plugin.c#L71 
<https://gitlab.xfce.org/Sylvain/xfce4-clipman-plugin/-/blob/secure_item_dbus/panel-plugin/main-panel-plugin.c#L71>

Then I may be able to add a callback

|g_signal_connect (G_OBJECT (window), "key_press_event", G_CALLBACK 
(my_keypress_function), NULL); |

to my own keyboard handler, and then dispatch on which keystroke I 
receive, right?
What about "activate" callback on enter key, should I call them after I 
introduce a keyboard handler?

If you have code example, I would love to discover how it works. 😁

Regards,
Sylvain.
||

-- 
Sylvain Viart - GNU/Linux Sysadmin/Developer/DevOps - France

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.xfce.org/pipermail/xfce4-dev/attachments/20210902/d5e155da/attachment.html>


More information about the Xfce4-dev mailing list