Skip to content

External keyboard don´t work with Ctrl + Shift + key #2726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Dioprz opened this issue Jun 4, 2020 · 8 comments
Closed

External keyboard don´t work with Ctrl + Shift + key #2726

Dioprz opened this issue Jun 4, 2020 · 8 comments
Labels

Comments

@Dioprz
Copy link

Dioprz commented Jun 4, 2020

Always kitty works perfect for me, but few days ago I am trying swap to Dvorak Keyboard Layout. This change did that when I use Ctrl + Shift + V, the shortcut don´t work BUT only in my external keyboard, because if I use in my notebook keyboard, it works normally.

Here is the output of --debug-keyboard with my notebook:

[155 17:57:52.558151] Ignoring unknown config key: dinamic_background_opacity
Press xkb_keycode: 0x25 clean_sym: Control_L composed_sym: Control_L mods: none glfw_key: 341 (LEFT CONTROL) xkb_key: 65507 (Control_L)
on_key_input: glfw key: 341 native_code: 0xffe3 action: PRESS mods: 0x0 text: '' state: 0 sent key to child
Press xkb_keycode: 0x32 clean_sym: Shift_L composed_sym: Shift_L mods: ctrl+numlock glfw_key: 340 (LEFT SHIFT) xkb_key: 65505 (Shift_L)
on_key_input: glfw key: 340 native_code: 0xffe1 action: PRESS mods: 0x2 text: '' state: 0 sent key to child
Press xkb_keycode: 0x3c clean_sym: v composed_sym: V mods: ctrl+shift+numlock glfw_key: 86 (V) xkb_key: 118 (v)
Keypress matched action: paste_from_clipboard
on_key_input: glfw key: 86 native_code: 0x76 action: PRESS mods: 0x3 text: '' state: 0 handled as shortcut
Release xkb_keycode: 0x3c clean_sym: v mods: ctrl+shift+numlock glfw_key: 86 (V) xkb_key: 118 (v)
on_key_input: glfw key: 86 native_code: 0x76 action: RELEASE mods: 0x3 text: '' state: 0 ignoring as keyboard mode does not allow release events
Release xkb_keycode: 0x32 clean_sym: Shift_L mods: ctrl+shift+numlock glfw_key: 340 (LEFT SHIFT) xkb_key: 65505 (Shift_L)
on_key_input: glfw key: 340 native_code: 0xffe1 action: RELEASE mods: 0x3 text: '' state: 0 ignoring as keyboard mode does not allow release events
Release xkb_keycode: 0x25 clean_sym: Control_L mods: ctrl+numlock glfw_key: 341 (LEFT CONTROL) xkb_key: 65507 (Control_L)
on_key_input: glfw key: 341 native_code: 0xffe3 action: RELEASE mods: 0x2 text: '' state: 0 ignoring as keyboard mode does not allow release events
Press xkb_keycode: 0x85 clean_sym: Super_L composed_sym: Super_L mods: numlock glfw_key: 343 (LEFT SUPER) xkb_key: 65515 (Super_L)
on_key_input: glfw key: 343 native_code: 0xffeb action: PRESS mods: 0x0 text: '' state: 0 sent key to child

And here with my external keyboard:

[155 18:00:33.206924] Ignoring unknown config key: dinamic_background_opacity
Press xkb_keycode: 0x25 clean_sym: Control_L composed_sym: Control_L mods: none glfw_key: 341 (LEFT CONTROL) xkb_key: 65507 (Control_L)
on_key_input: glfw key: 341 native_code: 0xffe3 action: PRESS mods: 0x0 text: '' state: 0 sent key to child
Press xkb_keycode: 0x32 clean_sym: Shift_L composed_sym: Shift_L mods: ctrl+numlock glfw_key: 340 (LEFT SHIFT) xkb_key: 65505 (Shift_L)
on_key_input: glfw key: 340 native_code: 0xffe1 action: PRESS mods: 0x2 text: '' state: 0 sent key to child
Press xkb_keycode: 0x3c clean_sym: v composed_sym: V mods: none glfw_key: 86 (V) xkb_key: 118 (v)
on_key_input: glfw key: 86 native_code: 0x76 action: PRESS mods: 0x0 text: '' state: 0 sent key to child
Release xkb_keycode: 0x3c clean_sym: v mods: none glfw_key: 86 (V) xkb_key: 118 (v)
on_key_input: glfw key: 86 native_code: 0x76 action: RELEASE mods: 0x0 text: '' state: 0 ignoring as keyboard mode does not allow release events
Release xkb_keycode: 0x32 clean_sym: Shift_L mods: none glfw_key: 340 (LEFT SHIFT) xkb_key: 65505 (Shift_L)
on_key_input: glfw key: 340 native_code: 0xffe1 action: RELEASE mods: 0x0 text: '' state: 0 ignoring as keyboard mode does not allow release events
Release xkb_keycode: 0x25 clean_sym: Control_L mods: ctrl+numlock glfw_key: 341 (LEFT CONTROL) xkb_key: 65507 (Control_L)
on_key_input: glfw key: 341 native_code: 0xffe3 action: RELEASE mods: 0x2 text: '' state: 0 ignoring as keyboard mode does not allow release events
Press xkb_keycode: 0x85 clean_sym: Super_L composed_sym: Super_L mods: numlock glfw_key: 343 (LEFT SUPER) xkb_key: 65515 (Super_L)
on_key_input: glfw key: 343 native_code: 0xffeb action: PRESS mods: 0x0 text: '' state: 0 sent key to child

This looks like mods being not detected in the same form, but i don´t know why.

Btw, this issue only happens me (until now) in Kitty.

I really appreciate any help.

System features:
Arch with I3WM
If it's of any use, default layout continue being QWERTY, and I swap to Dvorak with next command:
setxkbmap -layout us -variant dvorak-intl

@Dioprz Dioprz added the bug label Jun 4, 2020
@kovidgoyal
Copy link
Owner

Does this happen only with dvorak layout? And have you tried a reboot after switching layout?

@Dioprz
Copy link
Author

Dioprz commented Jun 4, 2020

Yeah, I tryed before with latam, uk, and us layout and all works fine. About reboot, I can't reboot cause my layout change is not persistent, so reboot only refresh my QWERTY layout. It's possible that this affect? I will try search how do it and edit this response with results.

@kovidgoyal
Copy link
Owner

Does this happen on existing kitty instances only and not with newly started kitty after the layout change?

@Dioprz
Copy link
Author

Dioprz commented Jun 5, 2020

This happen in all kitty instances, pre and post change.

This happen in all kitty instances, pre and post change.

Well, i can add more info that maybe can help.

I changed layout to persistant adding next command to my i3 start
setxkbmap -layout us,us,latam -variant "dvorak-intl,altgr-intl," -option grp:ctrls_toggle

(In first instance, i tryed do change with
localectl set-x11-keymap us,us,latam dvorak-intl,altgr-intl, grp:ctrls_toggle
but my ligthdm dont execute this configs or something like this because they don´t have any aparently effect)

When i used both commands and issue isn´t fixed, I think that maybe the trouble is that my command don´t apply change layout correctly to all devices, and it´s the reason to why it works in my notebook keyboard but no in the external, so i used:
setxkbmap -device 3,15 -layout us,us,latam -variant "dvorak-intl,altgr-intl," -option grp:ctrls_toggle
where 3,15 are my two keyboards. Again, this don´t work.

Any idea?

Ah, as well, shorcuts in ext. keyboard works perfectly for the two others keyboards layouts.

@kovidgoyal
Copy link
Owner

Sorry, I'm not a user of setxkbmap, cant help you with the correct
invocation for it to apply the layout to all connected keyboards.

@Dioprz
Copy link
Author

Dioprz commented Jun 5, 2020

I don´t ask for setxkbmap help. I mentioned it ´cause allowed me dismiss one possibility about invocation of my devices, but actually all info indicates that conflict cause is that kitty don´t register mods from my external keyboard correctly, like is showed in my first post.

@kovidgoyal kovidgoyal reopened this Jun 5, 2020
@Dioprz
Copy link
Author

Dioprz commented Jun 23, 2020

Unfortunetly, issue was not solved with this change. But even so, it modified something in my debugs logs:

External keyboard:

Press xkb_keycode: 0x25 clean_sym: Control_L composed_sym: Control_L mods: none glfw_key: 341 (LEFT CONTROL) xkb_key: 65507 (Control_L)
on_key_input: glfw key: 341 native_code: 0xffe3 action: PRESS mods: 0x0 text: '' state: 0 sent key to child
Press xkb_keycode: 0x32 clean_sym: Shift_L composed_sym: Shift_L mods: ctrl glfw_key: 340 (LEFT SHIFT) xkb_key: 65505 (Shift_L)
on_key_input: glfw key: 340 native_code: 0xffe1 action: PRESS mods: 0x2 text: '' state: 0 sent key to child
**Press xkb_keycode: 0x3c clean_sym: period composed_sym: V mods: none glfw_key: 46 (PERIOD) xkb_key: 46 (period)
on_key_input: glfw key: 46 native_code: 0x2e action: PRESS mods: 0x0 text: '' state: 0 sent key to child**
Release xkb_keycode: 0x3c clean_sym: period mods: none glfw_key: 46 (PERIOD) xkb_key: 46 (period)
on_key_input: glfw key: 46 native_code: 0x2e action: RELEASE mods: 0x0 text: '' state: 0 ignoring as keyboard mode does not allow release events

Laptop keyboard

Press xkb_keycode: 0x25 clean_sym: Control_L composed_sym: ISO_Prev_Group mods: none glfw_key: 341 (LEFT CONTROL) xkb_key: 65507 (Control_L)
on_key_input: glfw key: 341 native_code: 0xffe3 action: PRESS mods: 0x0 text: '' state: 0 sent key to child
Press xkb_keycode: 0x32 clean_sym: Shift_L composed_sym: Shift_L mods: ctrl glfw_key: 340 (LEFT SHIFT) xkb_key: 65505 (Shift_L)
on_key_input: glfw key: 340 native_code: 0xffe1 action: PRESS mods: 0x2 text: '' state: 0 sent key to child
**Press xkb_keycode: 0x3c clean_sym: v composed_sym: V mods: ctrl+shift glfw_key: 86 (V) xkb_key: 118 (v)
Keypress matched action: paste_from_clipboard**
on_key_input: glfw key: 86 native_code: 0x76 action: PRESS mods: 0x3 text: '' state: 0 handled as shortcut
Release xkb_keycode: 0x3c clean_sym: v mods: ctrl+shift glfw_key: 86 (V) xkb_key: 118 (v)
on_key_input: glfw key: 86 native_code: 0x76 action: RELEASE mods: 0x3 text: '' state: 0 ignoring as keyboard mode does not allow release events

Now, when I press ctrl + shift + v in my ext. keyboard (where 'V' is '>' for standard QWERTY US keyboard), composed_sym is the only that interpreter this like 'V', but everything else register like 'PERIOD' key. This did not happen before, but mods continue be none.
Adittionally, I discover this issue don't happen with all keys (allmost, but not all). For example, when i use ctrl + shift + t (where 't' in Dvorak is 'k' in standard QWERTY US keyboard), works perfectly and create other tab of kitty. Same for ctrl + shift + q (quit kitty instance), and ctrl + shift + n (open new kitty window).

I understand perfectly if this so particullary issue can result annoying to fix for you, but i want record just in case someone have this trouble and can be fix, maybe consider sending a contribution to you.

Thanks for trying to help me and for such a good terminal!

Good luck!

@Dioprz
Copy link
Author

Dioprz commented Sep 5, 2020

Hi again, and sorry for my so late feedback. Well, arch repository has have more that 2 or 3 updates of kitty package I think, so I don't know what update changed conditions of my issue but something did it.

Today when I saw my debug keyboard and test the problematics shorcuts, I obtain next logs: https://pastebin.com/wByp63Sb

I tried to do 2 things. First, use Ctrl + Shift + K (because in Dvorak layout, V key is K). He did nothing. Later I tried with Ctrl + Shift + V (again, in Dvorak interpretation, so I press "." key to obtain V). He did nothing. Finally I repeat Ctrl + Shift + K and leave Ctrl and Shift key's.

Logs until here: Line 1-29 [Notice 'Period' key event, i never touched this key in process]

I remembered that before (in previus comments), C + S + T worked to create a new tab, so I try just for check. Works perfectly. Then I tried one more time C + S + V and he works too, but no for paste: it move to next Kitty tab. As this worked then I tried with C + S + K (K=V Qwerty), and it worked!! It pasted from my clipboard.

Rest of process correspond to rest of logs.

I tried change the order of process, or watch if something more can activate this keyboard behavior without results.

Fix of C + S + K seems like it be persistant for the session, but i'm not sure.

So, for first time, paste works from my external keyboard in kitty, but works really weird and with QWERTY shorcuts, not Dvorak.

PD: Until now I ever hope for updates in package of Arch Repository update to test your changes in files, but this method is so slow; so i would really appreciate if you can indicate me where are kitty files to copy your updates in my files and try faster (probably a newbie question but when I searched for that, can't found).

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants