Sign in to follow this  
Followers 0
jaenster

How Hotkey works?

13 posts in this topic

He send the key that you pressed to the focused window , If it is a hotkey?


-jaenster

Share this post


Link to post
Share on other sites



Are you asking how to send the key you press to the window you are using if it is a hotkey? If your answer is yes below I have some code that may assist your endeavors.

HotKeySet("a", "somefunc")
While 1
   Sleep(100)
WEnd
Func somefunc()
   HotKeySet("a")
   Send("a")
   HotKeySet("a", "somefunc")
EndFunc

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Yeah i know that , but can you make it that he works only in your gui


-jaenster

Share this post


Link to post
Share on other sites

the 41 is asc from a? and 11?


-jaenster

Share this post


Link to post
Share on other sites

YOu dont aswer my qeustion

Again , "41" is asc of a ... so if its false , how i know what key what number is ?


-jaenster

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

YOu dont aswer my qeustion

Again , "41" is asc of a ... so if its false , how i know what key what number is ?

The "codes" that you use with this can be found here: MSDN Database

Though, this can be made much simpler by doing it like this(code taken from one of my gui scripts):

While 1
    If WinActive($wHandle) Then
        HotKeySet("B", "_sendB")
    Else
        HotKeySet("B")
    EndIf
    Sleep(100)
Wend

Func _sendB()
    HotKeySet("B")      ; <-- To prevent recursive stuff
    Send("B")
    HotKeySet("B", "_sendB")
EndFunc
Edited by FreeFry

Share this post


Link to post
Share on other sites

HotKeySet("{F1}", "HotKeyFunc")
HotKeySet("{F2}", "HotKeyFunc")

While True
    Sleep(60000)
WEnd

Func HotKeyFunc()
    If WinActive("WindowNameOrHandle") Then
        Switch @HotKeyPressed
        Case "{F1}"
        ; F1 action
        Case "{F2}"
        ; F2 action
        EndSwitch
    Else
        HotKeySet(@HotKeyPressed)
        Send(@HotKeyPressed)
        HotKeySet(@HotKeyPressed, "HotKeyFunc")
    EndIf
EndFunc

Share this post


Link to post
Share on other sites

Thanks and gamerman , look your singature ,

PS: The previous comment was a joke. Even tho I have seen some really bad sigs before none of them were on this fourm.

Wtf is a fourm ? ^^

-jaenster

Share this post


Link to post
Share on other sites

A fourm is a board where people can post about topics and reply to them. This is a fourm.

Share this post


Link to post
Share on other sites

I think he means to say that it's spelled forum, not fourm.

Share this post


Link to post
Share on other sites

Yeah i know but i wanna only say


-jaenster

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0