Skip to content
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

starting kloak resets keyboard layout #12

Open
adrelanos opened this issue Apr 10, 2019 · 7 comments · May be fixed by #73
Open

starting kloak resets keyboard layout #12

adrelanos opened this issue Apr 10, 2019 · 7 comments · May be fixed by #73
Assignees
Labels

Comments

@adrelanos
Copy link
Contributor

Starting kloak resets my keyboard layout type from de to en-US.

@vmonaco
Copy link
Owner

vmonaco commented Apr 10, 2019

Confirmed on Whonix 14 and Ubuntu. Always switches back to en-US from other layouts.

I'll investigate. This possibly has something to do with grabbing the device file.

@vmonaco vmonaco added the bug label Apr 10, 2019
@vmonaco vmonaco self-assigned this Apr 10, 2019
@HulaHoop0
Copy link

The TailsOS folks are also interested and will ship Kloak when this bug is squashed :)

https://lists.autistici.org/message/20190502.153722.2bd2b373.en.html

@OmarMesqq
Copy link

Confirmed on Arch Linux as well. Apparently, it only affects the keyboard layout on Xorg (I didn't test it on Wayland though). When I run # systemctl start kloak on the tty the layout stays the same. I have managed to mitigate this by adding a script that runs setxkbmap <layout> to the code but I'm investigating to see if I can find the origin of the bug in the codebase.

@adrelanos
Copy link
Contributor Author

I have managed to mitigate this by adding a script that runs setxkbmap <layout> to the code but I'm investigating to see if I can find the origin of the bug in the codebase.

Any chance?

@OmarMesqq
Copy link

OmarMesqq commented Dec 11, 2023

I was thinking of ways of solving this bug. Quite interesting to say the least, maybe it has something to do on how X11 (Wayland isn't supported, right?) handles the "sudden" change of device control takeover that kloak does. Here's a snippet of some logs:

Arg 0 Current keyboard layout: pc+br+inet(evdev)
Arg 1 Current keyboard layout: pc+br+inet(evdev)
Raw event: Time: 1702271333353, Device: 1, Type: 4, Code: 4, Value: 458803
Arg 2 Current keyboard layout: pc+br+inet(evdev)
Arg 3 Current keyboard layout: pc+br+inet(evdev)
Arg 0 Current keyboard layout: pc+br+inet(evdev)
Arg 1 Current keyboard layout: pc+br+inet(evdev)
Raw event: Time: 1702271333354, Device: 1, Type: 1, Code: 39, Value: 1
Arg 2 Current keyboard layout: pc+br+inet(evdev)
Arg 3 Current keyboard layout: pc+br+inet(evdev)
Arg 0 Current keyboard layout: pc+br+inet(evdev)
Arg 1 Current keyboard layout: pc+br+inet(evdev)
Raw event: Time: 1702271333355, Device: 1, Type: 0, Code: 0, Value: 0
Arg 2 Current keyboard layout: pc+br+inet(evdev)
Arg 3 Current keyboard layout: pc+br+inet(evdev)
;Arg 0 Current keyboard layout: pc+us+inet(evdev)
Arg 1 Current keyboard layout: pc+us+inet(evdev)
Raw event: Time: 1702271333457, Device: 1, Type: 4, Code: 4, Value: 458803
Arg 2 Current keyboard layout: pc+us+inet(evdev)

One can see when the bug happens in the line:

;Arg 0 Current keyboard layout: pc+us+inet(evdev)

My keyboard layout is pt_BR and the key I pressed is for the character ç. However, in the exact moment I press it,
the keyboard layout falls back to en_US and the key that should have been ç becomes ;

Edit 1: It definitely has to do with EVIOCGRAB - X11 falls back to default layout after the first keystroke

@AguirreIF
Copy link

Same issue with kloak 0.2.49 on GNU/Linux Debian Trixie.

@OmarMesqq OmarMesqq linked a pull request Jan 14, 2024 that will close this issue
@OmarMesqq
Copy link

hi everyone. i found a solution, when possible, please take a look at the pull request

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

Successfully merging a pull request may close this issue.

5 participants