SolvedAdding Multiple Global Hot Keys

Posts 14 of 4 · Page 1 of 1
Adding Multiple Global Hot Keys
I got this which is working fine But i want a multi global hotkey for example Ctrl p,Ctrl X, Ctrl Alt Del

Code:
   Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Int32) As Int16

        Dim hotkey As Boolean
        hotkey = GetAsyncKeyState(Keys.Home)
        If hotkey = True Then
           timer1.Start()
        End If
I tried
Code:
      Dim hotkey1 As Boolean
        Dim hotkey2 As Boolean
        hotkey1 = GetAsyncKeyState(Keys.Control)
        hotkey2 = GetAsyncKeyState(Keys.Home)
        If hotkey1 = True And hotkey2 = True Then
            tmrUsername.Start()
        End If
I also tried

Code:
   Dim hotkey As Boolean
        hotkey = GetAsyncKeyState(Keys.Control And Keys.Home)
        If hotkey = True Then
            tmrUsername.Start()
        End If
but none of these

I just want a hotkey like (Ctrl + P) both holded down not just one
@wilson945766:
Try this one:

Code:
        Dim HotKey As Boolean
        HotKey = GetAsyncKeyState(Keys.P)
        If My.Computer.Keyboard.CtrlKeyDown And HotKey Then
            tmrUsername.Start()
        End If
gimme a second let me try it

---------- Post added at 06:24 PM ---------- Previous post was at 06:15 PM ----------

@Hassan thankz it works now i know how to add even more hotkey

eg:
Code:
      Dim HotKey As Boolean
        HotKey = GetAsyncKeyState(Keys.T)
        If My.Computer.Keyboard.CtrlKeyDown And My.Computer.Keyboard.AltKeyDown And HotKey Then
            tmrUsername.Start()
        End If
Yeah cool. Marked Solved !
Posts 14 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?