Jump to content

HotKeySet and Keyboard Scancode


 Share

Recommended Posts

I would like to re purpose my unused keyboard keys into useful shortcuts.

HotKeySet("{BROWSER_FAVORITES}", "test")

Did not work.   The adjacent { BROWSER_BACK } and { BROWSER_FORWARD } do work with hotkeyset.


Function _Ispressed returns 0xAB, as the key scan code.


Is there a way to do HotKeySet(0xAB, "test)?  

I do not want to do

 

While True
            If _IsPressed(0xAB) Then
            FuncHere
            EndIf
            Sleep(100)
    Wend
Edited by DLS
Link to comment
Share on other sites

Hi @DLS

You can use _WinAPI_SetWindowsHookEx with $WH_KEYBOARD_LL (see the example in the function reference).

The scan code is in the $tagKBDLLHOOKSTRUCT and if you return 1 in the hook procedure, you can prevent the key from doing anything else.

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