sioyek icon indicating copy to clipboard operation
sioyek copied to clipboard

Possible to bind meta (command) key?

Open najjt opened this issue 1 year ago • 3 comments

Hi,

First of all, I greatly appreciate all the work you have done on this project.

To my question: is it possible to bind the meta key (i.e. the command key on macOS) in user-defined keybindings?

najjt avatar Feb 12 '24 14:02 najjt

<Cmd> works, for example, in keys_user.config:

toggle_fullscreen <C-Cmd-f>

jinjiaodawang avatar Feb 12 '24 16:02 jinjiaodawang

Thanks for the quick reply! This works, but I have found that just <C-x> binds to both control + x and meta + x. For my use case this is fine, but this could of course lead to confusion. Just <Cmd-x> does not work.

najjt avatar Feb 12 '24 16:02 najjt

I noticed that issue. The issue happens because the meta key event is not defined, both the meta key and the control key events are mapped to the same flag is_contol_pressed: https://github.com/ahrm/sioyek/blob/04780a82b16ccea4ece2964cfb730fc22dd5d02a/pdf_viewer/ui.cpp#L1584

jinjiaodawang avatar Feb 14 '24 02:02 jinjiaodawang

This is added in https://github.com/ahrm/sioyek/commit/35f0d63adab81028d3ca708119a9a5e420caefe2. You can now use C- and D- to bind control/command to keybindings, also works for windows and linux, you can use D- to bind windows/super keys.

ahrm avatar Mar 07 '24 08:03 ahrm