Bug 4550 - cannot assign key-bindings to menu items
Summary: cannot assign key-bindings to menu items
Status: NEW
Alias: None
Product: Claws Mail
Classification: Unclassified
Component: UI (show other bugs)
Version: 4.0.0
Hardware: PC OpenBSD
: P3 enhancement
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2021-11-17 11:13 UTC by Marco van Hulten
Modified: 2021-11-18 12:36 UTC (History)
0 users

See Also:


Attachments

Description Marco van Hulten 2021-11-17 11:13:57 UTC
In Configuration → Preferences... → Other → Miscellaneous, I have set "Enable keyboard shortcuts".
However, when I open the menu Tools → Actions, hover over an action and press 'a', nothing happens.
I expected that 'a' would be assigned as a hot-key.
Comment 1 Paul 2021-11-17 11:21:54 UTC
Unfortunately, keybindings have changed in gtk3. The gtk2 way no longer works, and instead keybindings in gtk3 have to be done via css. Or perhaps a custom way of handling them might be possible.

The problem here is that the old gtk2 prefs have not been removed in the gtk3 version of claws-mail.

Right now the only way to change keyboard shortcuts in in gtk3 claws-mail is to edit ~/.claws-mail/menurc in a text editor when claws-mail is not running.

This is area needs to be ported to gtk3, and so I am changing this to an "enhancement".
Comment 2 Ricardo Mones 2021-11-17 17:20:48 UTC
BTW Marco, in case you don't want to do it by hand you can easily edit menurc through Clawsker [1] hotkeys editor tab [2].

[1] https://www.claws-mail.org/clawsker.php
[2] https://git.claws-mail.org/?p=clawsker.git;a=blob_plain;f=ui/kde-hotkeys.png
Comment 3 Marco van Hulten 2021-11-18 10:54:19 UTC
Paul wrote:
> Right now the only way to change keyboard shortcuts in in gtk3
> claws-mail is to edit ~/.claws-mail/menurc in a text editor when
> claws-mail is not running.

If I do this (checked with 'ps' that claws-mail really isn't running),
Claws Mail overwrites my change, e.g.

; (gtk_accel_path "<MainwinActions>/Menu/Tools/Actions/Archief" "a")

is changed back to

; (gtk_accel_path "<MainwinActions>/Menu/Tools/Actions/Archief" "")

It doesn't seem right what I'm doing here.  'menurc' is
> an automated accelerator map dump
according to its header.  This, and the fact that all lines in 'menurc'
start with a semicolon alluding to comment, suggests that I should not
edit this file.

> This is area needs to be ported to gtk3, and so I am changing this to
> an "enhancement".

Very good!
Comment 4 Paul 2021-11-18 11:09:39 UTC
> If I do this (checked with 'ps' that claws-mail really isn't running),
> Claws Mail overwrites my change, e.g.
> 
> ; (gtk_accel_path "<MainwinActions>/Menu/Tools/Actions/Archief" "a")
> 
> is changed back to
> 
> ; (gtk_accel_path "<MainwinActions>/Menu/Tools/Actions/Archief" "")

It's changed back because you didn't remove the leading '; ', which is a comment. You need to remove the leading '; ' on those items you want to edit.

> It doesn't seem right what I'm doing here.  'menurc' is
> an automated accelerator map dump according to its header.  This, 
> and the fact that all lines in 'menurc' start with a semicolon alluding
> to comment, suggests that I should not edit this file.

I am suggesting, no, not suggesting, but directly saying that you should edit that file. But you will decide what you feel is right or wrong and act accordingly.
Comment 5 Marco van Hulten 2021-11-18 12:36:51 UTC
Thanks, this works.

Note You need to log in before you can comment on or make changes to this bug.