Jump to content

Where Are Hotkeyset In Autoitx?


Recommended Posts

I just download AutoIt today. After a hour try it. I decide to use AutoItX in C# (Visual Studio Pro 2005) thought COM interface. Everythings work fine but I can't find method HotKeySet that exist in AutoIt.

Do I must write my own code to handle key press event? If I must, can anyone guide me a good method.

Thanks

Link to comment
Share on other sites

:think:

That is a good question. There is an article about using hotkeys in C#. I find that a bit hard to understand but it works anyway.

Including hotkey-setting functions to AutoItX would be very nice.

Thanks. I solved it. But is there something doesnt good with autoit? I writing a program (threading thing) that helping me in a game. Something like I press 'a' it press 'b' as fast as possible then press 'a' again it stop. When I test it on notepad, the speed is very good. But in game it even slower than my hand. Both AutoIt and AutoItX are same.
Link to comment
Share on other sites

  • Moderators

:think:

Thanks. I solved it. But is there something doesnt good with autoit? I writing a program (threading thing) that helping me in a game. Something like I press 'a' it press 'b' as fast as possible then press 'a' again it stop. When I test it on notepad, the speed is very good. But in game it even slower than my hand. Both AutoIt and AutoItX are same.

If you don't mind using AutoIt specifically, you can adjust the Opt('SendKeyDelay') and the Opt('SendKeyDownDelay'), for typing a letter a bunch of times, you could Mod this I made today: http://www.autoitscript.com/forum/index.ph...ndpost&p=179238 to suit your needs, maybe even looking at the _IsPressed() function in the Beta HelpFile.

Or maybe:

Global $APressed = 1
HotKeySet('a', '_Send_B')

While 1
    Sleep(10000)
WEnd

Func _Send_B()
    Sleep(100)
    $APressed = Not $APressed
    While Not $APressed
        _Send_It('b')
    WEnd
    HotKeySet('a');Set the 'a' Hotkey to no function so we can send last 'a'
    Send('a')
    Return HotKeySet('a', '_Send_B');Reset Hotkey back to it's orignal state
EndFunc

Func _Send_It($v_Send, $i_SendDownDelay = 1, $i_SendKeyDelay = 1)
    $OptSendDownDelay = Opt('SendKeyDownDelay', $i_SendDownDelay)
    $OptSendKeyDelay = Opt('SendKeyDelay', $i_SendKeyDelay)
    Send($v_Send)
    Opt('SendKeyDownDelay', $OptSendDownDelay)
    Opt('SendKeyDelay', $OptSendKeyDelay)
EndFunc
That's of course if you want to use AutoIt itself and not the AuoItx (I don't know personally how it works).

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

I made it faster by creating 1 thread on 1 object. Last time I create all thread on 1 object and it slow.

However today SystemHotKey component cannot do 1 thing I'd like: It doesnt have WM_KEYDOWN and WM_KEYUP.

Ex:

In a game when I want to look behind I press 'a' and hold it. But SystemHotKey component only have 1 event WM_HOTKEY (similar to KeyPress event in C#)

If it have keyup and keydown event:

at keydown: au3.Send("{a down}",0);

at keyup: au3.Send("{a up}",0);

Anyone interesting to add 2 event KeyDown and KeyUp into SystemHotKey component? This will surely usefull. I doesnt good at this suff. It might take 2 much time for me to learn and code it. Even that I trying to code it now. But better If you can code it. >.<

Sorry for my bad english.

Link to comment
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
 Share

  • Recently Browsing   0 members

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