Sign in to follow this  
Followers 0
DLS

HotKeySet and Keyboard Scancode

2 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted

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.

1 person likes this

Share this post


Link to post
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
Sign in to follow this  
Followers 0