DreymaR / BigBagKbdTrixPKL

"DreymaR's Big Bag of Keyboard Tricks" for Windows with EPKL
Other
326 stars 32 forks source link

EPKL Does Not Work With Password Manager Auto Type #54

Open Jackabomb opened 1 year ago

Jackabomb commented 1 year ago

Awesome software, thank you! It allows me to try Colemak at work where I don't have admin privileges.

I noticed, however, that my password manager's auto type (KeePass 2) has broken. For example, instead of jackabomb, it types naceabymb.

jackabomb <- expected naceabymb <- gotten

naceabymb is, coincidentally, what you get if a QWERTY user tries to type jackabomb on Colemak.

Sure enough, AHK history reveals KeePass attempting to use QWERTY and AHK ~interfering~ doing its job. Unless otherwise noted, type i events are AHK while type h events are KeePass.

VK SC Type Up/Dn Elapsed Key Window Notes
4A 024 h u 0.00 j Keepass. We just missed the very start of the auto type
4E 031 i d 0.01 n AHK
4E 031 i u 0.00 n
41 01E h d 0.03 a
41 01E h u 0.00 a
41 01E i d 0.01 a
41 01E i u 0.00 a
43 02E h d 0.03 c
43 02E h u 0.00 c
43 02E i d 0.02 c
43 02E i u 0.00 c
4B 025 h d 0.03 k
4B 025 h u 0.00 k
41 01E h u 0.02 a Me, releasing the hotkey that triggered the auto type (Ctrl+Alt+A)
45 012 i d 0.00 e
45 012 i u 0.00 e
A4 038 u 0.02 LAlt Me, releasing the hotkey that triggered the auto type (Ctrl+Alt+A)
41 01E h d 0.01 a
41 01E h u 0.00 a
A2 01D u 0.00 LControl Me, releasing the hotkey that triggered the auto type (Ctrl+Alt+A)
41 01E i d 0.02 a
41 01E i u 0.00 a
42 030 h d 0.03 b
42 030 h u 0.00 b
42 030 i d 0.02 b
42 030 i u 0.00 b
4F 018 h d 0.03 o
4F 018 h u 0.00 o
59 015 i d 0.02 y
59 015 i u 0.00 y
4D 032 h d 0.03 m
4D 032 h u 0.00 m
4D 032 i d 0.01 m
4D 032 i u 0.00 m
42 030 h d 0.03 b
42 030 h u 0.00 b
42 030 i d 0.01 b
42 030 i u 0.00 b
74 03F h d 2.97 F5 C:\Users\xxxxxxx\Downloads\EPKL_Executable_v1-4-0\EPKL.exe Me, updating the AHK history
74 03F i d 0.02 F5 Me, updating the AHK history

If I turn off EPKL, this is the output. We can see the whole invocation this time. Interestingly, I get the same (correct) result if I switch the Windows layout to Dvorak (with EPKL still turned off). This suggests that KeePass detects the active keyboard layout and adjusts accordingly. Indeed, their web site warns

KeePass does not know the keyboard layout that has been selected in a remote desktop or virtual machine window. If you want to auto-type into such a window, you must ensure that the local and the remote/virtual system are using the same keyboard layout.

KeePass Auto-Type Requirements and Limitations This supports the idea that they do know the layout normally.

VK SC Type Up/Dn Elapsed Key Window Notes
A2 01D d 3.20 LControl TypeRacer - Play Typing Games and Race Friends - Google Chrome Me, invoking auto type
A4 038 d 0.08 LAlt Me, invoking auto type
A4 038 d 0.50 LAlt Me, invoking auto type
A4 038 d 0.03 LAlt Me, invoking auto type
A4 038 d 0.05 LAlt Me, invoking auto type
A4 038 d 0.03 LAlt Me, invoking auto type
A4 038 d 0.03 LAlt Me, invoking auto type
A4 038 d 0.03 LAlt Me, invoking auto type
A4 038 d 0.03 LAlt Me, invoking auto type
A4 038 d 0.03 LAlt Me, invoking auto type
A4 038 d 0.03 LAlt Me, invoking auto type
A4 038 d 0.03 LAlt Me, invoking auto type
A4 038 d 0.05 LAlt Me, invoking auto type
A4 038 d 0.03 LAlt Me, invoking auto type
41 01E d 0.02 a Me, invoking auto type
A2 01D a u 0.01 LControl Me, invoking auto type
A4 038 a u 0.00 LAlt Me, invoking auto type
4A 024 a d 0.02 j
4A 024 a u 0.00 j
41 01E a d 0.05 a
41 01E a u 0.00 a
41 01E u 0.03 a
43 02E a d 0.02 c
43 02E a u 0.00 c
A4 038 u 0.01 LAlt
4B 025 a d 0.02 k
4B 025 a u 0.02 k
A2 01D u 0.01 LControl
41 01E a d 0.02 a
41 01E a u 0.00 a
42 030 a d 0.05 b
42 030 a u 0.01 b
4F 018 a d 0.03 o
4F 018 a u 0.01 o
4D 032 a d 0.03 m
4D 032 a u 0.00 m
42 030 a d 0.05 b
42 030 a u 0.00 b
74 03F d 1.55 F5 C:\Users\xxxxxxx\Downloads\EPKL_Executable_v1-4-0\EPKL.exe Me, refreshing AHK history

So. I'm not even convinced this is a bug in EPKL or KeePass. Perhaps it's merely an unfortunate point of incompatibility, but I'd appreciate any thoughts or ideas on the subject, or any possible workarounds. For the moment, I just switch layouts in EPKL when I need auto type, but that is inconvenient.

Thanks again! πŸ˜ƒ

P.S. Yes, this took like an hour to compose. 75% drop in speed hurts so bad... 😭 Ah, the agony of switching layouts!

DreymaR commented 1 year ago

Interesting! No, it doesn't count as a bug on either side but it is a delicate interaction.

You can of course suspend EPKL by hotkey whenever you want to use KeePass. Or even make EPKL auto-suspend by active program and/or web page, if that helps. But it doesn't sound like a complete solution.

The issue is that KeePass really does its thing, hard core. EPKL doesn't work in some password windows because they don't respect its i (inserted) events to keep things safe. KeePass circumvenes this problem by sending actual "physical" h (hard) events. Respect. But this makes EPKL capture and remap its output (or maybe it's the other way around, idk) – uh-oh...

It's theoretically possible to make passwords for yourself that are layout agnostic. But I can't recommend that too loudly, as it will reduce the number of available keys for passwords by quite a few which means a bit less security. What I can say however, is that actual password security correlates more with password length than with human-perceived complexity!

On a side note: If writing a long post takes too much of your time, you could try a Tarmak transition? But now that you've started with the cold-turkey approach I guess you'll want to continue with that.