I'm trying to emulate the hotkey functionality in AHK with VB.Net. Basically, mirror it identically. I'm not entirely sure how to get started. I did get something basic operational, however, it's a far cry from AHK's awesome native functionality. This will be developed for windows.
VB.NET Code
Code: Select all
Imports System.Runtime.InteropServices
Imports System.Timers
Public Class Form1
Private Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Integer) As Integer
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Timer1.Enabled = True
Timer1.Interval = 1
End Sub
Private Sub Timer1_Tick(ByVal Sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If GetKeyPress(Keys.A) And GetKeyPress(Keys.Enter) Then
MsgBox("A And Enter Pressed")
Exit Sub
End If
End Sub
End Class
Looking for a nudge, or an example to get started.