Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with windows key as trigger
#1
I have a macro that works fine with a key like F3 as the trigger. I want to use Wg (windows + g) as the trigger. If I use that trigger:
- the macro works fine if I put a delay of 0.2 at the top
- with a delay of 0.1 or no delay all sort of strange things happen:
  • * I'm logged of, have to enter my username to log in again
    * when I'm logged in the ease of access center dialog is showing, the narrator has been activated
    * the run-dialog from the start menu is open

All this does not happen if I use the Wg trigger with a simple macro that displays a message box.

I'm using windows 10, I have 'use low-level hook' checked.

The macro code is below, the purpose of the macro is, when a windows explorer window is active, to get the address of the folder it's showing, and show the same folder on my memory stick in the same explorer window (with the $Personal$ part omitted)

Macro memstick_show_same_dir
Trigger Wg     Help - how to add the trigger to the macro
Code:
Copy      Help
int memstickdrivenummer = try_findfile_on_drive2("x:\memstick.txt")
if memstickdrivenummer = 0  
,mes "memstick not found"
,end

int w=win("" "CabinetWClass")
str dirname.getwintext(id(1001 w)) ;;get text/name of address bar

if dirname.begi("address:")
,dirname.get(dirname 8)
dirname.trim

str mydocs.expandpath("$personal$")
if dirname.beg(mydocs)
,dirname.get(dirname,len(mydocs)+1)
,dirname.from("x:\" dirname)
dirname[0] = memstickdrivenummer

iff-(dirname)
,mes "Directory does not exist on memstick"
,,end
'Cl(dirname)Y  ;;activate address bar and type memstick path
0.05

act child("" "DirectUIHWND" w 0x0 "accName=Items View") ;;list 'Items View'

(The try_findfile_on_drive2 gets the driveletter of the memorystick)

Can anybody tell me what the problem is?
#2
Better don't use Win key triggers with macros that send keys.
QM can hide trigger keys from applications but not from OS.
For example, Win+L locks computer. Although QM "releases" the trigger Win key before starting the macro, OS still knows that it is pressed, and if the macro sends key L, it works like Win+L.
#3
Thanks for your reply.

With the delay of 0.2 seconds it works ok. So the OS has 'forgotten' after this 0.2 seconds that the win key has been pressed?

Can you tell me:
  • Is there a setting in windows 10 that I can change so that windows 'forgets' this press of the Win key after a shorter time (say 0.05 seconds)?

    Is there a way to check and wait inside the qm macro that windows has forgotten that the win key has been pressed, so that I don't have to wait any longer than necessary before sending keystrokes? (I tried with int vk=wait(0.2 K W) but this always yields a timeout, probably because to qm the win key is already up)

By the way, I didn't have this problem with win key triggers in windows xp with macros that send keystrokes. So maybe it's something that can be easily fixed in future version of qm?
#4
I cannot answer the questions.
Check "When released" in macro Properties dialog.
On my PC Win+G shows "Do you want to open Game bar?" temporarily, but no other anomalies.
#5
Checking "When Released" solved the problem.

Thanks!


Forum Jump:


Users browsing this thread: 1 Guest(s)