<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Thank you Gaël,<br>
<br>
I managed to add the two keybinding I was thinking about!<br>
<br>
now DEL key removes an item dynamically from the history, by
visually selecting it in the menu.<br>
I also added S key (lower case) to Swap / Secure an Item.<br>
<br>
S was in conflict with Accelerator for History dialog box. 😉<br>
Now history open by H.<br>
It's mainly for testing, because I didn't want to bind two
distinct keys that almost execute the same code. (DRY code)<br>
<br>
<a moz-do-not-send="true"
href="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</a><br>
<br>
Thanks for your help, excellent!<br>
<br>
I own you a fresh beer! 😉<br>
<br>
Regards,<br>
Sylvain.<br>
<br>
On 03/09/2021 10:49, Gaël Bonithon wrote:<br>
</div>
<blockquote type="cite"
cite="mid:LNsZ1-Rm3WjNz3xqacrwJiEQMSg7GWDtlRctpknXe7Wo_vH0ITW1ea4rcs-vIgGnr8y--6IwVJrskw3yrDk7zSyxMbnYWjjHn0BwYbhzSq0=@protonmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div>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.<br>
</div>
<div><br>
</div>
<div>No need to bother with what you say in the first part, it
should work by itself in this case.<br>
</div>
<div><br>
</div>
<div>Don't forget to disconnect `my_keypress_function()` when the
menu disappears though (GtkMenuShell's "selection-done"
signal should be fine).<br>
</div>
<div><br>
</div>
<div class="protonmail_signature_block">
<div class="protonmail_signature_block-user">
<div>Cheers,<br>
</div>
<div>Gaël<br>
</div>
</div>
</div>
<div><br>
</div>
<div class="protonmail_quote"> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br>
On Thursday, September 2nd, 2021 at 6:20 AM, Sylvain Viart
<a class="moz-txt-link-rfc2396E" href="mailto:sylvain@opensource-expert.com"><sylvain@opensource-expert.com></a> wrote:<br>
<blockquote class="protonmail_quote" type="cite"> Hi,<br>
<br>
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.<br>
<br>
<br>
I lack gtk knowledge, what I found is that:<br>
[...]<br>
</blockquote>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Sylvain Viart - GNU/Linux Sysadmin/Developer/DevOps - France</pre>
</body>
</html>