Results 1 to 4 of 4
  1. #1
    wilson945766's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    New york
    Posts
    10
    Reputation
    10
    Thanks
    1
    My Mood
    Angelic

    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
    Last edited by wilson945766; 02-05-2012 at 03:58 PM.

  2. #2
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    @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

  3. The Following User Says Thank You to Hassan For This Useful Post:

    wilson945766 (02-05-2012)

  4. #3
    wilson945766's Avatar
    Join Date
    Dec 2008
    Gender
    male
    Location
    New york
    Posts
    10
    Reputation
    10
    Thanks
    1
    My Mood
    Angelic
    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

  5. #4
    Hassan's Avatar
    Join Date
    May 2010
    Gender
    male
    Location
    System.Threading.Tasks
    Posts
    4,764
    Reputation
    495
    Thanks
    2,133
    My Mood
    Dead
    Yeah cool. Marked Solved !

Similar Threads

  1. Auto Hot Key?
    By .Aeon in forum Combat Arms Help
    Replies: 2
    Last Post: 10-14-2009, 03:18 AM
  2. [REQUEST][IDEA]CA Spammer w/ Hot Keys
    By Pixie in forum Combat Arms Discussions
    Replies: 9
    Last Post: 09-06-2009, 12:09 PM
  3. hot keys
    By jesussoto100 in forum Combat Arms Help
    Replies: 11
    Last Post: 08-30-2009, 11:00 AM
  4. hot keys
    By jesussoto100 in forum Combat Arms Hacks & Cheats
    Replies: 7
    Last Post: 08-30-2009, 01:22 AM
  5. Hot Keys
    By nub_g0t_high in forum Visual Basic Programming
    Replies: 3
    Last Post: 10-22-2007, 05:07 PM