[solved] Send keyboard button "k"

Get help with using AutoHotkey and its commands and hotkeys
robhayes
Posts: 19
Joined: 28 Dec 2015, 15:35

[solved] Send keyboard button "k"

01 Jan 2016, 16:59

Hello,

I am having difficulty getting my script to press 'k' in a way that can be detected by this dialog box: i.imgur.com/NZOqd5y.jpg

Here is my code:

Code: Select all

Else If Pedersen = quad ; quad mons
{
    gui_destroy()
    Send, +{F3} ;
	sleep, 20000 ; 
	SendInput {Raw}k ;
	run "C:\Program Files\Rainmeter\Rainmeter.exe" !LoadLayout "Dec 28"
	Send {F9}
}
Preferably, the script could also wait for this dialog box to appear and then immediately click 'k', rather than my guestimation of 20 seconds it takes for it to appear. However I'd be just as happy if you just tell me how to make the keypress 'k' work

Thanks in advance for any assistance.
Last edited by robhayes on 02 Jan 2016, 11:49, edited 1 time in total.
lexikos
Posts: 7195
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Send keyboard button "k"

01 Jan 2016, 22:13

Are you sure that pressing "k" on the keyboard activates that button? It's hard to tell without the underline showing (Keep Changes).

If this window is shown by a program which runs as administrator, see the FAQ: How do I work around problems caused by User Account Control (UAC)?

Otherwise, I'd suggest trying ControlClick; something like this:

Code: Select all

WinWait Monitor Configuration
ControlClick Keep Changes

Code: Select all

WinWait Monitor Configuration
ControlClick Button1

Code: Select all

Sleep 20000
ControlClick Button1
robhayes
Posts: 19
Joined: 28 Dec 2015, 15:35

Re: Send keyboard button "k"

02 Jan 2016, 11:49

Turns out the easiest solution was just to disable these prompts in DisplayFusion. Consider this one solved, thanks!

Return to “Ask For Help”

Who is online

Users browsing this forum: Bad husband, Bing [Bot], LeFunk, mikeyww, neo256, scriptor2016 and 41 guests