Jump to content

_hotkeyset udf


tengwer
 Share

Recommended Posts

I remember seeing a UDF called _HotkeySet which was pretty cool. I've looked all over and can see where it's been used in the forum but can't find where to download it. Could someone direct me? Is there one place I can go to find all the current UDFs and help file for them? Thanks for your help! ;)

Link to comment
Share on other sites

No. If you do a search for _hotkeyset you'll see where this is used but I can't find where you can download it. ;)

Exactly which _hotkeyset are you talking about? Link please.
Link to comment
Share on other sites

#include <Misc.au3>
Global $Key1 = "2C"
Global $Key2 = "11"
Global $Key3 = ""

$dll = DllOpen("user32.dll")

While 1
    If $Key1 <> "" AND $Key2 = "" AND $Key3 = "" Then 
        If _IsPressed($Key1, $dll) Then 
            $ButtonState = "Pressed"
            Pressed()
        EndIf
    EndIf
    If $Key1 <> "" AND $Key2 <> "" AND $Key3 = "" Then
        If _IsPressed($Key1, $dll) AND _IsPressed($Key2, $dll) Then 
            $ButtonState = "Pressed"
            Pressed()
        EndIf
    EndIf   
    If $Key1 <> "" AND $Key2 <> "" AND $Key3 <> "" Then
        If _IsPressed($Key1, $dll) AND _IsPressed($Key2, $dll) AND _IsPressed($Key3, $dll) Then 
            $ButtonState = "Pressed"
            Pressed()
        EndIf
    EndIf   
WEnd

Func Pressed()
    ;MsgBox(0,"","")
    Sleep(600)
    If $Key1 <> "" AND $Key2 = "" AND $Key3 = "" Then 
        If _IsPressed($Key1, $dll) Then 
            $ButtonState = "Held"
        EndIf
    EndIf
    If $Key1 <> "" AND $Key2 <> "" AND $Key3 = "" Then
        If _IsPressed($Key1, $dll) AND _IsPressed($Key2, $dll) Then 
            $ButtonState = "Held"
        EndIf
    EndIf   
    If $Key1 <> "" AND $Key2 <> "" AND $Key3 <> "" Then
        If _IsPressed($Key1, $dll) AND _IsPressed($Key2, $dll) AND _IsPressed($Key3, $dll) Then 
            $ButtonState = "Held"
        EndIf
    EndIf   
If $ButtonState = "Pressed" Then MsgBox(0,"_IsPressed", "Pressed")
If $ButtonState = "Held" Then MsgBox(0,"_IsPressed", "Held")
EndFunc


DllClose($dll)
The UDF you mentioned may be the one I saw a while ago so thanks for the tip but since then I have created something that meets my needs even better. It is a script that can call a function based on wether a key or combination of keys is either pressed or pressed and held. The script is as follows. Let me know what you think. ;)
Link to comment
Share on other sites

#include <Misc.au3>
Global $Key1 = "2C"
Global $Key2 = "11"
Global $Key3 = ""

$dll = DllOpen("user32.dll")

While 1
    If $Key1 <> "" AND $Key2 = "" AND $Key3 = "" Then 
        If _IsPressed($Key1, $dll) Then 
            $ButtonState = "Pressed"
            Pressed()
        EndIf
    EndIf
    If $Key1 <> "" AND $Key2 <> "" AND $Key3 = "" Then
        If _IsPressed($Key1, $dll) AND _IsPressed($Key2, $dll) Then 
            $ButtonState = "Pressed"
            Pressed()
        EndIf
    EndIf   
    If $Key1 <> "" AND $Key2 <> "" AND $Key3 <> "" Then
        If _IsPressed($Key1, $dll) AND _IsPressed($Key2, $dll) AND _IsPressed($Key3, $dll) Then 
            $ButtonState = "Pressed"
            Pressed()
        EndIf
    EndIf   
WEnd

Func Pressed()
    ;MsgBox(0,"","")
    Sleep(600)
    If $Key1 <> "" AND $Key2 = "" AND $Key3 = "" Then 
        If _IsPressed($Key1, $dll) Then 
            $ButtonState = "Held"
        EndIf
    EndIf
    If $Key1 <> "" AND $Key2 <> "" AND $Key3 = "" Then
        If _IsPressed($Key1, $dll) AND _IsPressed($Key2, $dll) Then 
            $ButtonState = "Held"
        EndIf
    EndIf   
    If $Key1 <> "" AND $Key2 <> "" AND $Key3 <> "" Then
        If _IsPressed($Key1, $dll) AND _IsPressed($Key2, $dll) AND _IsPressed($Key3, $dll) Then 
            $ButtonState = "Held"
        EndIf
    EndIf   
If $ButtonState = "Pressed" Then MsgBox(0,"_IsPressed", "Pressed")
If $ButtonState = "Held" Then MsgBox(0,"_IsPressed", "Held")
EndFunc


DllClose($dll)
The UDF you mentioned may be the one I saw a while ago so thanks for the tip but since then I have created something that meets my needs even better. It is a script that can call a function based on wether a key or combination of keys is either pressed or pressed and held. The script is as follows. Let me know what you think. ;)

The two keys I set in the variables above are the ctrl and printscreen key. From 1 to 3 keys can be used as you can see.
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...