Jump to content

Question about hotkeys


PcExpert
 Share

Recommended Posts

Hi all,

I want to let something run if I press a key conbination. For example: I press the keys 001 and then a msgbox pops up. But I didn't find a way to do that. So my question is: Is there a way to do that? And if yes, how? This is my test code:

HotKeySet("001", "func1")

While 1
Sleep(10)
WEnd

Func Func1()
    MsgBox(64, "test", "test")
EndFunc

Thanks!

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

I don't want to just give you the correct link, but want to help you find it.

- open the search

- type "mousehook" into the search field (without quotes)

- select "AutoIT V3" in the "Search Where" list, as first try, just to be sure

- press search

- now focus on the "Topic Starter" column, try to find a post from Larry

- if you found Larry's post, look at the thread title, if it might be of interest

- have fun :)

Link to comment
Share on other sites

OK, thanks! I found the post now, but how do I let a program run when I press for example 001? While the mousehook program was active I pressed 001, then the program adds 3 lines to the tooltip, but what do I have to do with the info?

Link to comment
Share on other sites

This was fun to make, and a great way to learn about GUIGetMsg() :lmao:

#region Unimportant stuff
Const $WH_KEYBOARD = 2
Const $WM_KEYUP H

ÈLÌÛÛÝ ÌÍÕÓWÒÑVQÕÓH

ÈLÌBÛØ[ ÌÍÛ  3c¶×6rÂb33c¶'VffW"ÒgV÷C²gV÷C²Âb33c¶Ò¢b33c¶wVÒuT7&VFRgV÷íÑÍÐÅÕ½Ðì¤)±½°ÀÌØí11¥¹ÍÐô11
±° ÅÕ½Ðí­É¹°Ìȹ±°ÅÕ½Ðì°ÅÕ½Ðíwnd","LoadLibrary","str",".\hook.dll&quoÊBÛØ[ ÌÍÚÙ^RÓÒÜØÈHØ[
    ][ÝÚÙ[Ì ][ÝË  ][ÝÚÛ    V÷C²ÂgV÷C´vWE&ö4FG&W72gV÷C²ÂgV÷C¶væBgV÷C²Âb33c´DÄÄç7E³ÒÂgV÷C·7G"ÅÕ½Ðì°ÅÕ½Ðí-åAɽÅÕ½Ðì¤)±½°ÀÌØí¡¡-äô11
±° ÅÕ½ÐíÕÍÈÌȹ±°ÅÕt;,"hwnd","SetWindowsHookEx","int",$WH_KVPÐT  ][ÝÚÛ    ][ÝË  ÌÍÚÙ^RÓÒÜØÖÌK ][ÝÚÛ    ][ÝË  3c´DÄÆç7E³ÒÂgV÷C¶çBgV÷C²Ã¤DÄÄ6ÆÂgV÷C¶öö²æFÆÂgV÷C²ÂgV÷C¶çBgVÐì°ÅÕ½ÐíMÑY±ÕÍ-äÅÕ½Ðì°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°ÀÌØíÕ¤°ÅÕ½Ðí¡Ý¹ÅÕ½Ðì°À6;hhKey[0])
GUIRegisterMsg($WM_KEYDOWN,"myKeyfunc")
#endregiÛÚ[HBTÛY
L
BÑ[[ÈÖÓÛJ
BSÙÐÞ
    ][ÝÉ][ÝË    ]÷C³2&W76VBgV÷C² W@¤VæDgVæ0 ¢7&VvöâgVæ7Föç2&WV&V@¤gVæ2×åÕ¹ ÀÌØí¡]¹U$°ÀÌØí5Í%°ÀÌØí]AÉ´°ÀÌØí1AÉ´¤(%M±Ð($%
e $i = 0
            If $WParam = 0x00000060 OR $WParam = 0x00000030 [BBBIÌÍÚHHBBBQ[ÙBBBBIÌÍÚHHBBQ[YBPØÙH   ÌÍÚHHHBbb33cµu&ÒÒcõ"b33cµu&ÒÒ3FVà b33c¶ôÈ($$%±Í($$$$ÀÌØí¤ôÀ($$%¹%($%
ÍÀÌØí¤ôÈ($$%%ÀÌØí]AÉ´ 0x00000061 OR $WParam = 0x00000031 Then
                ZeroZeroOne()
            Else
            IÌÍÚHHBBQ[YQ[Ù[XÝ[[Â[ÈÛ]]Ò]^]

BØ[
    V÷C·W6W#3"æFÆÂgV÷C²ÂgV÷C¶çBgV÷C²ÂgV÷CµVæööµvæF÷w4öö´WgV÷C²ÂgV÷C¶Ý¹ÅÕ½Ðì°ÀÌØí¡¡-ålÁt¤(11
±° ÅÕ½Ðí­É¹°Ìȹ±°ÅÕ½Ðì°ÅÕ½Ðí¥¹ÐÅÕt;,"FreeLibrary","hwnd",$DLLinst[0])
EndFunc
#endrYÚ[Û
Edited by Manadar
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...