auto-type user and password not working (too fast?)

Bug #1783873 reported by Martin Wildam
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
keepass2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Since I am on a new machine with Ubuntu 18.04 (previously on 14.04 and 16.04 - and worked on both) I have a problem with auto-type (keepass2 v2.39.1).

On various websites (be it LinkedIn, XING, Outlook Web Access and many others) I cannot auto-type user AND password (usually sequence {USERNAME}{TAB}{PASSWORD}{ENTER}).

The user name still gets typed correctly, but then somehow on or after the {TAB} the problem begins as on {ENTER} I get notified by the websites that I typed a wrong password. As there are only asterix characters I cannot exactly tell where it fails.

To me it seems that after the {TAB} some characters are not auto-typed correctly. However the cursor lands in the password field and also does type something. I think some characters simply get lost. My new machine is quite fast and probably it would help if auto-type would be a little slower (just a guess).

My current workaround is to have two autotype sequences: One for {USERNAME}{TAB} and the other for {PASSWORD}{ENTER}. So I have two press two times the hotkey for auto-type choosing the first sequence and then the second. Doing it this way works.

Revision history for this message
Christophe Perrot (krys74) wrote :

Hello,

first of all I know that might not be seen as appropriate on bug trackers, sorry if it's the case : I'm on Debian Stretch 9 with Keepass 2.35 and experiencing the same problem (I have another machine with Ubuntu but I have no access to it at the moment to test) : auto-type worked well with previous release and is now malfunctioning.
I should also mention that I have 2 keymaps configured : Franch (variante) and Bepo.
Do not know if the bug is due to Keepass or has something to do with xsel/xdotools.

I could see that in the password some characters are switched for others. That's not always the case, auto typing twice in a row will not always give the same result.

@Martin : to confirm if it's the same for you : you can open a text editor (gedit for instance), then go to Keepass, select your entry and right clic on it -> Perform auto-type (Ctrl+V).
This should do the auto-typing in your text editor and so you will be able to see if there is an error in the auto-type password.

I don't know if it's the same for you, but copying user name to cliboard (CTRL+B), pasting it, then copying password to clipboard (Ctrl+C) works well.

Revision history for this message
Christophe Perrot (krys74) wrote :

For what it's worth : just tried removing my second keyboard layout (Bepo) and now Keepass2 auto-typing seems to work properly.

@Martin : do you have 2 keyboard layouts defined ? Are you using Gnome Desktop, as I do ?

Revision history for this message
Christophe Perrot (krys74) wrote :

I found a new element after digging a bit into xdotool problems with multiple keyboard layouts.

First of all, Ubuntu 18.04 and Debian Jessie apparently ship the same version of xdotool : 1:3.20160805.1-3, which would explain why I observe the same problem as Martin.

After reading some dialogs in Jordanissel/xdotool's Github (https://github.com/jordansissel/xdotool/issues/), I tried changing my global Keepass auto-type shortcut (CTRL-ALT-A) in Parameters/Keyboard
from :
mono /usr/lib/keepass2/KeePass.exe --auto-type

to :
/usr/bin/setxkbmap fr oss; mono /usr/lib/keepass2/KeePass.exe --auto-type

(fr oss being my primary keyboard layout)

It seems to solve the problem (hae yet to confirm in the long run, but for the time being that does the trick)

@Martin : could you try modifying your global auto-type shortcut prepending it with somthing like '/usr/bin/setxkbmap at' or '/usr/bin/setxkbmap de' (choose the right one) and tell us ?

Thanks

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in keepass2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Dominik (burnin2leo) wrote :

Also confirm this bug after update to 18.04.

As a workaround it helps (often) to add a delay in the KeePass autotype sequence:

{USERNAME}{TAB}{DELAY 600}{PASSWORD}{ENTER}

I also encounter display timing issues in different programs (e.g., Firefox, KeePass, VeraCrypt) that may relate to this issue. Specifically, it takes some time before the typed text or additional menus appear (Firefox, VeryCrypt) and if text is selected, it disappears (KeePass).

Revision history for this message
Christophe Perrot (krys74) wrote :

Thanks Dominik for your comment.

I don't know if it has something to do with timing issues, but before the update to Debian Stretch (which ships the same xdotool as Ubuntu 18.04, in comment #3 I wrongly cited "Jessie", I was talking about "Stretch" ), I was not having these problems.

Changing my shortcut (CTRL-ALT-A) to '/usr/bin/setxkbmap fr oss; mono /usr/lib/keepass2/KeePass.exe --auto-type' seemed to do the trick for 'Perform auto-type' (CTRL-V) but was not working for my global auto-type CTRL-ALT-A (it seemed not to do anything). Perhaps because I don't know how t correctly specify a keyboard shortcut with more than 1 command in Gnome shell.
As a workaround, I made a shell script with these 2 commands (setxkbmap and mono) and now I call this script with CTRL-ALT-A. 'Perform auto-type' (CTRL-V) as well as Global auto-type (CTRL-ALT-A) now seem to work flawlessly (at least it has been the case for several days now).
So I really suspect the problem has something to do with the management of keyboards when more than 1 is set in Gnome.

@Dominik : do you have more than 1 keyboard layout set as input ?

Revision history for this message
Martin Wildam (mwildam) wrote :

Sorry for the delay.

@Christophe Perrot (krys74): I don't have more than one keyboard layouts. So if you find this to be an issue in your case then you have a different problem than me. However, I tried with editor and retried posting user name and password a lot of times - always with correct result.
In my tests I found out that in Firefox on sites where I did not decide yet whether to save passwords or not on this site (you see the key symbol on the left next to the url) then on tab somethings looks like to steal the focus for a moment and of course that may then consume a posted character before the password field gets the focus.

However, on other sites where I already decided to never save passwords, the issue also occurs. These sites are sometimes a little slow in reaction due to a lot of javascript stuff that wants to run (some stuff is prevented by Adblock plus and NoScript).

@Dominik (burnin2leo):
Yes, it must be some timing issue - thanks for the tip with the delay! That works like a charm! Thumbs up - you made my day! On one site that always has the issue a delay of {DELAY 500} was sufficient.

Revision history for this message
Martin Wildam (mwildam) wrote :

When I switched over to Ubuntu 18.04 I also switched hardware to a much faster one. So really that can be the reason why I did not have the problem earlier.

I was not aware of the fact that there is such a thing like the {DELAY 500} autotype command. This is fully sufficient for me!

Revision history for this message
Pedro Miguel de Andrade Quental Mendes (pal-mendes) wrote :

I also had problems and got to this page when looking for a solution. The delay command didn't solve my problem. In my case, the username field was still ending up with only an ending part of the full string. I could test that with a text file where I auto-typed the login.
Reading the documentation, I found the clearfield command. It solved my problem.
{CLEARFIELD}{USERNAME}{TAB}{DELAY 100}{PASSWORD}{ENTER}

If you want to test it out with a text file, please hit return twice before auto typing.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.