Jump to content

Recommended Posts

Posted (edited)

LAST VERSION - 1.0

10-May-11

This is a very small but useful UDF library for support native API HotKey controls. This library is written similary as other AutoIt GUI libraries. For more information, see detailed descriptions of all functions inside GuiHotKey.au3.

If you need more capacity to work with hot keys, you can use >HotKey UDF and >HotKeyInput UDF libraries.

HotKey.png

Available functions

_GUICtrlHotKey_Create

_GUICtrlHotKey_Destroy

_GUICtrlHotKey_GetHotKey

_GUICtrlHotKey_GetKeys

_GUICtrlHotKey_MakeKeyCode

_GUICtrlHotKey_SetHotKey

_GUICtrlHotKey_SetRules

HotKey UDF Library v1.0

Previous downloads: 117

HotKey.zip

Example

#include <GUIConstantsEx.au3>
#include <GUIHotKey.au3>

Global $HK, $VK

$hForm = GUICreate("MyGUI", 300, 92)
$hHotKey = _GUICtrlHotKey_Create($hForm, _GUICtrlHotKey_MakeKeyCode($HOTKEYF_ALT, $VK_F5), 20, 20, 260, 19)
$Button = GUICtrlCreateButton('OK', 115, 54, 70, 23)
GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $Button
            $Code = _GUICtrlHotKey_GetHotKey($hHotKey)
            _GUICtrlHotKey_GetKeys($Code, $HK, $VK)
            MsgBox(64, "Info", "Hot key code:" & @TAB & "0x" & Hex($Code, 4) & @CR & "Key modifier flags:" & @TAB & "0x" & Hex($HK, 2) & @CR & "Virtual key code:" & @TAB & "0x" & Hex($VK, 2), 0, $hForm)
    EndSwitch
WEnd
Edited by Yashied
Posted

I did the same thing last year. I just got mine out to test though and there are a few bugs, so I'll probably be using yours from now on :unsure:

The one thing I did like about mine was that it autoit hotkey strings rather than virtual keys. Saves a lot of hassle. All I need to do is fix mine so that using letters means lower case letter output unless shift is pressed (like autoit does).

Posted

Thanks this is very good i post this crapy array thing but yours is far far beyond better.. this will be usefull....

@Off-Topic: I think the only problem with this forum is that it is very large and many things happen unnoticed

  • 4 weeks later...
Posted (edited)

Thanks Yashied for this UDF very nice

There is one thing missing.. i cannot select the Pause Key and as far as i know this key isn't used a lot. Very useful as a hotkey.

Cheers

Emiel

Edited by Emiel Wieldraaijer

Best regards,Emiel Wieldraaijer

  • 2 weeks later...
  • 1 year later...
Posted

Hi :)

Very nice UDF ! Thanks a lot ! It was really helpfull !

BTW, when I try to use it with the function "_IsPressed" it works with every HotKey like "A, B, C, F12, F5, etc..." but it doesn't work with CTRL + F2 or ALT + F1

If _IsPressed(Hex($Code, 4))

There is another way to do this?

Thank ! :)

  • 11 months later...

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...