Jump to content

Recommended Posts

Posted

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)

  • 3 weeks later...
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
Posted

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

Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...