Jump to content
Sign in to follow this  
Westi

Systemwide keyhook

Recommended Posts

I want to write a systemwide keyhook to check if 'F1' is pressed.

In VB you call

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal uAction As Long) As Long
and check
GetAsyncKeyState(112) <> 0

I cannot translate the code to AutoIt and suppress the original function (help).

In VB it looks like

Private Declare Function GetAsyncKeyState Lib "user32" (ByVal uAction As Long) As Long
Private Sub Form_Load()
While 1
If GetAsyncKeyState(112) <> 0 Then MsgBox "F1 pressed"
Wend
End Sub

Maybe someone give me a hint...or the right code :(

Share this post


Link to post
Share on other sites

Very thank you, but the original function of 'F1' is already enabled.

Can we disable this behaviour?

Share this post


Link to post
Share on other sites

To explain:

The keyhook works, but if you ran an application, the functionkey already has both functions (HELP and AutoIt's).

The origin function is executed first, can we catch up this or make them ignore?

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...