how to catch keystroke in clipman menu?

Sylvain Viart sylvain at opensource-expert.com
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)

https://gitlab.xfce.org/Sylvain/xfce4-clipman-plugin/-/merge_requests/1/diffs#9ccec1d9c5b9b6500f958458cfe0b9d1a4ad557e_650_729 
<https://gitlab.xfce.org/Sylvain/xfce4-clipman-plugin/-/merge_requests/1/diffs#9ccec1d9c5b9b6500f958458cfe0b9d1a4ad557e_650_729>

Thanks for your help, excellent!

I own you a fresh beer! 😉

Regards,
Sylvain.

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 opensource-expert.com> 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: <https://mail.xfce.org/pipermail/xfce4-dev/attachments/20210904/1a47607f/attachment.html>


More information about the Xfce4-dev mailing list