Press Button to send a key to specific application

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
rspai
Posts: 9
Joined: 15 Oct 2019, 03:38

Press Button to send a key to specific application

08 Dec 2019, 02:11

I have a Windows tablet and I dont want to use the on-screen keyboard but use a Gui button to send a key to a specific window. I am new to AutoHotkey.

Hence, the requirement is a Gui button should be displayed on the screen. On pressing the button, the key "n" should be sent to the MediaPlayerClassicW (ahk_class) window.

Please help with an ahk script for this. Thanks.
rspai
Posts: 9
Joined: 15 Oct 2019, 03:38

Re: Press Button to send a key to specific application

08 Dec 2019, 02:57

Code: Select all

#SingleInstance,force
#d::
gui, add, button, x5 y30 h20 w70 gsub2, Next
Gui, Show
return



sub2:
Gui,Hide
{
send n	
}
sleep 200
Gui, Show
return
The above code sends the "n" key to the windows below the Gui Button named "next"

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 163 guests