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

new autotype in KDE not working #1738

Closed
newhinton opened this issue Mar 11, 2021 · 22 comments
Closed

new autotype in KDE not working #1738

newhinton opened this issue Mar 11, 2021 · 22 comments
Assignees
Labels
› Auto-type Auto-type functionality in desktop apps Build ◦ Desktop Specific to desktop Build ◦ Linux Specific to Linux Type ◦ Bug Something isn't working
Milestone

Comments

@newhinton
Copy link

Describe the bug
Using the new auto-type implementation makes the system unusable. Capslock seems to be stuck (only in software, the keyboard doesn't show capslock, which is probably expected behaviour), left mouse click is not working properly anymore (links in browser open in new window instead of just opening, and the OS-Buttons dont react sometimes)

Also, passwords are typed wrong so that the login fails. This can only be corrected with either rebooting or logging out and back into the system. Closing keepass (via kill or ksysguard) does not solve this issue.

It seems that the new implementation leaves an modifier key on.
Desktop OS: kubuntu 20.04
plasmashell 5.18.5

Legacy Auto-Type works as expected

To Reproduce
Steps to reproduce the behavior:

  1. Use Autotype in 1.17 or 1.17.1

Expected behavior
Autotype should work like older versions using xdotool

Environment
KeeWeb v1.17.1 (c638fa3, 2021-03-10)
Environment: electron v12.0.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) KeeWeb/1.17.1 Chrome/89.0.4389.69 Electron/12.0.0 Safari/537.36

Kdbx File
Personal DB. Will check Demo database when updating this ticket with logs

Logs
(Will add logs later)

@newhinton newhinton added the Type ◦ Bug Something isn't working label Mar 11, 2021
@Battleman
Copy link

I face the same issue. After some debugging, here are some info on my side:

  • Only happens in 1.17 and 1.17.1 (tested both), not present in 1.16 and earlier
  • I'm also on GNU/Linux (Pop!_OS 20.10, Gnome 3.38.3)
  • The exact behaviour I observe is that the Shift key is stuck. When I type after an autotype, everything is caps-locked, but also the numbers/symbols rows, and using ctrl-tab in browser is always translated into ctrl-shift-tab. This correlates with @newhinton (click -> shift+click -> open in new tab, etc).
  • I can revert to the normal state by pressing the Shift key, alone, once.
  • It happens with passwords who require a capital letter, or use at all the Shift modifier. For a password that is qwer123Sqwer123 (notice the capital S), autotype will yield qwer123SQWER+"* (Swiss qwertz keyboard)

I suspect this is related to jordansissel/xdotool#43

@antelle
Copy link
Member

antelle commented Mar 11, 2021

Thanks for the detailed description, I'll try to reproduce it, meanwhile you can switch to legacy auto-type in settings / advanced.

@antelle antelle added › Auto-type Auto-type functionality in desktop apps Build ◦ Desktop Specific to desktop Build ◦ Linux Specific to Linux labels Mar 11, 2021
@antelle antelle added this to the v1.17.x milestone Mar 11, 2021
@AwesamLinux
Copy link

I'm also seeing the same issue as described by @newhinton with the new Keepass auto-type feature on Linux Mint 20.1 Cinnamon.

KeeWeb v1.17.1 (c638fa3, 2021-03-10)
Environment: electron v12.0.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) KeeWeb/1.17.1 Chrome/89.0.4389.69 Electron/12.0.0 Safari/537.36

@antelle
Copy link
Member

antelle commented Mar 13, 2021

I tried hard, but I can't reproduce it. It works for me on Ubuntu and KUbuntu with English and German layouts, so I need some help with testing. I can make a build with more logging, or just a standalone app that does auto-type, would anyone be able to spend some time on testing it?

@Battleman
Copy link

Sure, don't hesitate to drop me a line, I'd gladly spend some time on that. Long time user, very happy with the app. It's the least I can do.

@antelle
Copy link
Member

antelle commented Mar 13, 2021

@Battleman thank you! 🙏

I made a minimalistic example that types Hello!, let's see if this one works for you: example.zip

Expected output:

$ ./example 
Active window pid: 3815, window_id: 44040199, app_name: "Code", title: "auto-type-linux.cpp - keyboard-auto-type - Visual Studio Code", url: ""
key_move down 65505
key_move down 72
lock_modifiers 0 -> 1
lock_modifiers 1 -> 0
key_move up 72
lock_modifiers 0 -> 1
lock_modifiers 1 -> 0
key_move up 65505
key_move down 101
key_move up 101
key_move down 108
key_move up 108
key_move down 108
key_move up 108
key_move down 111
key_move up 111
key_move down 65505
key_move down 33
lock_modifiers 0 -> 1
lock_modifiers 1 -> 0
key_move up 33
lock_modifiers 0 -> 1
lock_modifiers 1 -> 0
key_move up 65505
$ Hello!

@newhinton
Copy link
Author

newhinton commented Mar 13, 2021

I ran that, and this is the output:

Active window pid: 10731, window_id: 184549383, app_name: "konsole", title: "Desktop : bash — Konsole", url: ""
key_move down 65505
key_move down 72
lock_modifiers 16 -> 1
lock_modifiers 1 -> 16
HX Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 135 (XKEYBOARD)
Minor opcode of failed request: 5 (XkbLatchLockState)
Serial number of failed request: 33
Current serial number in output stream: 34

and it spamms uppercase H (until ctrl-c exits the program). Also, the same issues as before

@antelle
Copy link
Member

antelle commented Mar 13, 2021

Good, so it repeats, thank you! I'll try to understand and fix the error later today. Meanwhile, to fix KeeWeb, you can switch to legacy auto-type in Settings / Advanced.

@newhinton
Copy link
Author

newhinton commented Mar 13, 2021

I already switched back, that works flawless!

I have to add something:
It seems that this time as soon as the program is stopped, the modifier-effect is still enabled. However, as soon as i manually press shift, everything returns back to normal.

@antelle
Copy link
Member

antelle commented Mar 13, 2021

Do you have Caps Lock pressed when doing auto-type? I just managed to reproduce it if I press Caps Lock before, which means I can start working on a fix.

@newhinton
Copy link
Author

Not caps-lock (i tried that, enabled/disabled, neither changes the behaviour)

However Num-Lock seems to be an issue

if i disable numlock, i get the desired output:

Active window pid: 11695, window_id: 171966471, app_name: "konsole", title: "Desktop : bash — Konsole", url: ""
key_move down 65505
key_move down 72
lock_modifiers 0 -> 1
lock_modifiers 1 -> 0
Hkey_move up 72
lock_modifiers 0 -> 1
lock_modifiers 1 -> 0
key_move up 65505
key_move down 101
key_move up 101
ekey_move down 108
key_move up 108
lkey_move down 108
key_move up 108
lkey_move down 111
key_move up 111
okey_move down 65505
key_move down 33
lock_modifiers 0 -> 1
lock_modifiers 1 -> 0
!key_move up 33
lock_modifiers 0 -> 1
lock_modifiers 1 -> 0
key_move up 65505

@antelle
Copy link
Member

antelle commented Mar 13, 2021

Cool, so now I think I understand it. Perhaps what happens, it tries to "unpress" the pressed "Caps/Num Lock" key, and this triggers an error. The fix should be easy, I'll post the same fixed example here when it's ready.

@antelle
Copy link
Member

antelle commented Mar 13, 2021

Here's a fixed example:
example.zip

@newhinton
Copy link
Author

For me, your fixed example works!

One note though, i don't know if thats expected or not, when caps-lock was enabled before the program is run, the ascii output gets inverted. (Hello! -> hELLO!) (the exclamationmark stays the same)

@antelle
Copy link
Member

antelle commented Mar 13, 2021

Yep, noticed that too, I'll fix this as well and build KeeWeb with it to test

antelle pushed a commit to antelle/keyboard-auto-type that referenced this issue Mar 13, 2021
@antelle antelle self-assigned this Mar 13, 2021
@antelle
Copy link
Member

antelle commented Mar 13, 2021

CapsLock seems to be a bit harder to fix, so I'll leave it for later, since it's also broken in the legacy auto-type.
I made a build of KeeWeb with this version of the library: https://storage.googleapis.com/beta.keeweb.info/keeweb-linux-x64.zip

It works for me with different modifiers pressed (apart from CapsLock of course). Could you please give it a test?

@newhinton
Copy link
Author

Your fix works, thank you!

It may be argued that capslock is working as intended, albeit i see that it would be useful to have that work as well.

On a different topic, but also regarding auto-type:
The original keepass application has something called Two-Channel Auto-Type Obfuscation. Is this something you consider important to implement it into your auto-type library?

@antelle
Copy link
Member

antelle commented Mar 13, 2021

Cool, I'll make a release with it soon then.
The obfuscation would be harder to make in the library, but it's supported in KeeWeb, you can enable it in entry settings, it's called "Mix real keystrokes with random".

@antelle
Copy link
Member

antelle commented Mar 13, 2021

v1.17.2 is released 🎉 , please give it a try and let me know if it fixes the issue!
(don't forget to disable legacy auto-type before testing)

@Battleman
Copy link

All good, fixed in my end. Thanks a lot for that, I appreciate 👏

@AwesamLinux
Copy link

I can confirm, works for me too 👍

@antelle
Copy link
Member

antelle commented Mar 13, 2021

Thank you for verifying the fix and your patience! 🙏
Auto-type support is new in KeeWeb v1.17, now it's written in C++ which is supposed to give us more freedom in customizing it and better speed. I see that it already fixed a number bugs we had previously with xdotool.
But as a downside, v1.17 will be a little bit less stable compared to previous releases while we're fixing these issues with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
› Auto-type Auto-type functionality in desktop apps Build ◦ Desktop Specific to desktop Build ◦ Linux Specific to Linux Type ◦ Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants