wrong key state when there is a UAC pop-up

Report problems with documented functionality
xianyukang
Posts: 1
Joined: 25 May 2018, 06:12

wrong key state when there is a UAC pop-up

25 May 2018, 06:32

#UseHook

settimer, timer_5, 100
return

timer_5:
tooltip % getkeystate("5", "P")
return

*5::return

1. press 5 down
2. pop up a UAC prompt
3. after closing the UAC prompt, 5 is permanently down
lexikos
Posts: 6200
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: wrong key state when there is a UAC pop-up

25 May 2018, 22:26

I think this is unavoidable. The OS does not notify us that the key was released, therefore as far as we know, it is still down.

Changing the UAC setting to "not dim my desktop" may work around this. "Dim the desktop" actually means "display the dialog on an alternative Desktop which other processes cannot access, and also show a dimmed screenshot in the background". While the user is looking at this other desktop, keyboard input is directed there, not at the desktop which the script is running under. It is much the same as when the workstation is locked or you switch users.
malcev
Posts: 97
Joined: 12 Aug 2014, 12:37

Re: wrong key state when there is a UAC pop-up

26 May 2018, 18:13

"Dim the desktop" actually means "display the dialog on an alternative Desktop which other processes cannot access
You can run any process in UAC desktop with PsExec.exe.
https://docs.microsoft.com/en-us/sysint ... ads/psexec

Code: Select all

С:\Test\PsExec /h /x /d /s "С:\Test\script.exe"
lexikos
Posts: 6200
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: wrong key state when there is a UAC pop-up

01 Jun 2018, 01:54

Replace "other processes cannot access" with "processes running on other desktops cannot access the windows of or send keystrokes to" or something along those lines.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 5 guests