how to catch keystroke in clipman menu?

Sylvain Viart <[email protected]>
Newsgroups gmane.comp.desktop.xfce.devel.version4
Message-ID <[email protected]>
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

_______________________________________________
Xfce4-dev mailing list
[email protected]
https://mail.xfce.org/mailman/listinfo/xfce4-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.