sioyek icon indicating copy to clipboard operation
sioyek copied to clipboard

Backtick not working

Open wramalho opened this issue 3 years ago • 10 comments

Hi! My Sioyek does not understand my backtick keypress as '`' but as "P" (apparently)

Additional info:

  • Installed through sioyek-git from AUR

Logs below:


~ sioyek
default_config_path: /etc/sioyek/prefs.config
default_keys_path: /etc/sioyek/keys.config
user_config_path: [ 0 ] /etc/xdg/sioyek/prefs_user.config
user_config_path: [ 1 ] /home/wramalho/.config/sioyek/prefs_user.config
user_keys_path: [ 0 ] /etc/xdg/sioyek/keys_user.config
user_keys_path: [ 1 ] /home/wramalho/.config/sioyek/keys_user.config
database_file_path: /home/wramalho/.local/share/sioyek/test.db
local_database_file_path: /home/wramalho/.local/share/sioyek/local.db
global_database_file_path: /home/wramalho/.local/share/sioyek/shared.db
tutorial_path: /usr/share/sioyek/tutorial.pdf
last_opened_file_address_path: /home/wramalho/.local/share/sioyek/last_document_path.txt
shader_path: /usr/share/sioyek/shaders
Creating shared memory block...
Shared memory created: this is the primary application.
Starting IPC server...
IPC server started.
Warning: key defined in /etc/sioyek/keys.config line 76 is being overwritten in file /etc/sioyek/keys.config line 164
Warning: overriding command for h : replacing prev_state with add_highlight
Warning: key defined in /etc/sioyek/keys.config line 74 is being overwritten in file /etc/sioyek/keys.config line 262
Warning: overriding command for l : replacing next_state with overview_definition
**^[	^[	Warning: invalid command (key:P); resetting to root
Warning: invalid command (key:P); resetting to root
Warning: invalid command (key:u); resetting to root
Warning: invalid command (key:P); resetting to root**

wramalho avatar May 25 '22 21:05 wramalho

That is weird. Are you using a standard keyboard layout? Is your keyboard language set to english?

ahrm avatar May 26 '22 08:05 ahrm

I'm having the same issue, installed from AUR and backtick is detected as P. Zoom in also does not work even though it is reported as key:+ in the terminal output. My locale as reported by localectl status

   System Locale: LANG=es_AR.UTF-8
                  LANGUAGE=en_US.UTF-8
                  LC_MESSAGES=en_US.UTF-8
       VC Keymap: la-latin1
      X11 Layout: latam

miguel9554 avatar Jun 18 '22 21:06 miguel9554

My locale as reported by localectl status

System Locale: LANG=en_US.UTF-8 LC_NUMERIC=pt_BR.UTF-8 LC_TIME=pt_BR.UTF-8 LC_MONETARY=pt_BR.UTF-8 LC_PAPER=pt_BR.UTF-8 LC_NAME=pt_BR.UTF-8 LC_ADDRESS=pt_BR.UTF-8 LC_TELEPHONE=pt_BR.UTF-8 LC_MEASUREMENT=pt_BR.UTF-8 LC_IDENTIFICATION=pt_BR.UTF-8 VC Keymap: us-acentos X11 Layout: us X11 Variant: intl

 Should I send any additional relevant info to help with this issue? Sorry for the late reply, I was travelling :)

wramalho avatar Jun 21 '22 13:06 wramalho

For what it's worth, sioyek is dealing with keys in a very ad-hoc way and seems to make the assumption that some keysym always corresponds to the same modifiers, across layouts. This is not a good idea.

For example on a French keyboard, / is accessed with Shift, but the (default) mapping expects it to be accessed without Shift, so that the search mapping is not triggered. In a similar way, the default mapping for the command line is <S-:> (since : is accessed with Shift on an English keyboard ??), but this is not the case on a French keyboard, so unless you remap it to plain : it will not work.

The way modifiers are handled maybe works for letters and digits, but other characters to be handled differently. I think the code responsible is in input.cpp on those lines.

gapato avatar Jul 11 '22 12:07 gapato

This is probably fixed in 8b742a101a442d56e63fd187d91f6c79d05232fb. Note that in order to keep backwards compatibility, new changes are disabled by default. In order to enable them you should add this to your prefs_user.config:

use_legacy_keybinds 0

Also note that when you enable this, some of your previous keybinds may stop working because previously in order to have shift modified version of keys, we had to have something like this in keys:

zoom_in <S-+>

but now we just have to write

zoom_in +

so you have to redefine all the commands that use shift modified keys.

ahrm avatar Jul 14 '22 12:07 ahrm

Thank you @ahrm!

I've done some quick testing and it seems to fix the problem on my end. What do you think about updating the default config files to use this by default on new install?

gapato avatar Jul 18 '22 07:07 gapato

I think for now we should add a separate keys_new.config file to the repository which uses the new bindings and ask the user to replace their keys.config with that if they want to (in order to keep backwards compatiblity). We will probably use the new bindings as default when we release sioyek 2.0 (which won't be soon).

ahrm avatar Jul 18 '22 08:07 ahrm

I think for now we should add a separate keys_new.config file to the repository which uses the new bindings and ask the user to replace their keys.config with that if they want to (in order to keep backwards compatiblity). We will probably use the new bindings as default when we release sioyek 2.0 (which won't be soon).

and where is the keys_new.config?

raffaem avatar Sep 05 '22 20:09 raffaem

The latest main repository contain the keys_new.config file as well as a script to install it.

Are there a lot of user-defined config files that we can't make this the default?

raffaem avatar Sep 12 '22 08:09 raffaem

I will make this the default when we release sioyek 2.0 as this is a backward incompatible change.

ahrm avatar Sep 12 '22 08:09 ahrm

It is the default now.

ahrm avatar Dec 06 '22 11:12 ahrm