• Log in or sign up for an account here: https://www.sythe.org/login

[Source] Easy global hotkeys for VB.net

Blupig

BEEF TOILET

$5 USD Donor
Joined
Nov 23, 2006
Sythe Gold
1,609
Messages
7,145
Age
33
Location
Canada
Valentine's Singing Competition Winner
Sythe Awards 2015 Winner
Sythe Awards 2016 Winner
Sythe Awards 2020 Winner
Member of the Month Winner
MushyMuncher
Gohan has AIDS
Extreme Homosex
World War 3
I'm LAAAAAAAME
Discord Verified
Off Topic Participant
Code:
Private Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Integer) As Integer

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If GetKeyPress(Keys.Enter) Then
            MsgBox("Enter was pressed yo")
        End If
    End Sub

I can't believe I didn't think of doing this before, I've been using overrides this whole time for hotkeys D:

If you want to use complex hotkeys, then change the if statement:
Code:
        If GetKeyPress(Keys.Control) & GetKeyPress(Keys.Alt) & GetKeyPress(Keys.A) Then
            MsgBox("F5")
        End If

(That's for Ctrl+Alt+A)
 
Runescape Gamblingrunescape gambling
Back
Top