how to catch keystroke in clipman menu?

Sylvain Viart sylvain at
Sat Sep 4 18:04:48 CEST 2021

Thank you Gaël,

I managed to add the two keybinding I was thinking about!

now DEL key removes an item dynamically from the history, by visually 
selecting it in the menu.
I also added S key (lower case) to Swap / Secure an Item.

S was in conflict with Accelerator for History dialog box. 😉
Now history open by H.
It's mainly for testing, because I didn't want to bind two distinct keys 
that almost execute the same code. (DRY code) 

Thanks for your help, excellent!

I own you a fresh beer! 😉


On 03/09/2021 10:49, Gaël Bonithon wrote:
> You can just connect `my_keypress_function()` when the menu is shown 
> (GtkWidget's "show" signal), then, when a key is pressed, you look at 
> which key it is, which menu item is active, and act (or not) accordingly.
> No need to bother with what you say in the first part, it should work 
> by itself in this case.
> Don't forget to disconnect `my_keypress_function()` when the menu 
> disappears though (GtkMenuShell's "selection-done" signal should be fine).
> Cheers,
> Gaël
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> On Thursday, September 2nd, 2021 at 6:20 AM, Sylvain Viart 
> <sylvain at> wrote:
>> 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.
>> I lack gtk knowledge, what I found is that:
>> [...]

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Xfce4-dev mailing list