Thread: 4 button hotkey

Results 1 to 3 of 3
  1. #1
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,086
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful

    Exclamation 4 button hotkey

    Hey guys alittle help here.

    What is the code for if the user holds the 3, 0, 2, and 1 all at the same time and that triggers a new window to come up.

    how would i do that?
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

  2. #2
    NextGen1's Avatar
    Join Date
    Dec 2009
    Gender
    male
    Location
    Not sure really.
    Posts
    6,312
    Reputation
    382
    Thanks
    3,019
    My Mood
    Amazed
    GetKeyboardState API function is your best bet.

    [php]
    Declare Function GetKeyboardState Lib "user32" (pbKeyState As Byte) As Long
    [/php]


    Example:

    [php]
    Imports System.Runtime.InteropServices

    Public Class Form1
    <DllImport("user32.dll")> _
    Public Shared Function GetKeyboardState(ByVal keystate As Byte()) As Integer
    End Function
    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
    Dim keys__1 As Byte() = New Byte(254) {}

    GetKeyboardState(keys__1)

    If keys__1(CInt(Keys.Up)) = 129 AndAlso keys__1(CInt(Keys.Right)) = 129 Then
    Console.WriteLine("Up Arrow key and Right Arrow key down at the same time")
    End If
    End Sub
    End Class
    [/php]

    Virtual Keys

    [php]
    Imports System.Runtime.InteropServices
    Imports System
    Imports System.Collections.Generic
    Imports System.Text
    Namespace PInvoke.Net
    Public Class Keyboard
    <DllImport("user32.dll")> _
    Private Shared Function GetKeyState(ByVal nVirtKey As VirtualKeyStates) As Short
    End Function

    Public Shared Function IsKeyPressed(ByVal testKey As VirtualKeyStates) As Boolean
    Dim keyPressed As Boolean = False
    Dim result As Short = GetKeyState(testKey)

    Select Case result
    Case 0

    keyPressed = False
    Exit Select

    Case 1

    keyPressed = False
    Exit Select
    Case Else


    keyPressed = True
    Exit Select
    End Select

    Return keyPressed
    End Function

    Public Enum VirtualKeyStates As Integer
    VK_LBUTTON = &H1
    VK_RBUTTON = &H2
    VK_CANCEL = &H3
    VK_MBUTTON = &H4
    '
    VK_XBUTTON1 = &H5
    VK_XBUTTON2 = &H6
    '
    VK_BACK = &H8
    VK_TAB = &H9
    '
    VK_CLEAR = &HC
    VK_RETURN = &HD
    '
    VK_SHIFT = &H10
    VK_CONTROL = &H11
    VK_MENU = &H12
    VK_PAUSE = &H13
    VK_CAPITAL = &H14
    '
    VK_KANA = &H15
    VK_HANGEUL = &H15

    VK_HANGUL = &H15
    VK_JUNJA = &H17
    VK_FINAL = &H18
    VK_HANJA = &H19
    VK_KANJI = &H19
    '
    VK_ESCAPE = &H1B
    '
    VK_CONVERT = &H1C
    VK_NONCONVERT = &H1D
    VK_ACCEPT = &H1E
    VK_MODECHANGE = &H1F
    '
    VK_SPACE = &H20
    VK_PRIOR = &H21
    VK_NEXT = &H22
    VK_END = &H23
    VK_HOME = &H24
    VK_LEFT = &H25
    VK_UP = &H26
    VK_RIGHT = &H27
    VK_DOWN = &H28
    VK_SELECT = &H29
    VK_PRINT = &H2A
    VK_EXECUTE = &H2B
    VK_SNAPSHOT = &H2C
    VK_INSERT = &H2D
    VK_DELETE = &H2E
    VK_HELP = &H2F
    '
    VK_LWIN = &H5B
    VK_RWIN = &H5C
    VK_APPS = &H5D
    '
    VK_SLEEP = &H5F
    '
    VK_NUMPAD0 = &H60
    VK_NUMPAD1 = &H61
    VK_NUMPAD2 = &H62
    VK_NUMPAD3 = &H63
    VK_NUMPAD4 = &H64
    VK_NUMPAD5 = &H65
    VK_NUMPAD6 = &H66
    VK_NUMPAD7 = &H67
    VK_NUMPAD8 = &H68
    VK_NUMPAD9 = &H69
    VK_MULTIPLY = &H6A
    VK_ADD = &H6B
    VK_SEPARATOR = &H6C
    VK_SUBTRACT = &H6D
    VK_DECIMAL = &H6E
    VK_DIVIDE = &H6F
    VK_F1 = &H70
    VK_F2 = &H71
    VK_F3 = &H72
    VK_F4 = &H73
    VK_F5 = &H74
    VK_F6 = &H75
    VK_F7 = &H76
    VK_F8 = &H77
    VK_F9 = &H78
    VK_F10 = &H79
    VK_F11 = &H7A
    VK_F12 = &H7B
    VK_F13 = &H7C
    VK_F14 = &H7D
    VK_F15 = &H7E
    VK_F16 = &H7F
    VK_F17 = &H80
    VK_F18 = &H81
    VK_F19 = &H82
    VK_F20 = &H83
    VK_F21 = &H84
    VK_F22 = &H85
    VK_F23 = &H86
    VK_F24 = &H87
    '
    VK_NUMLOCK = &H90
    VK_SCROLL = &H91
    '
    VK_OEM_NEC_EQUAL = &H92


    VK_LSHIFT = &HA0
    VK_RSHIFT = &HA1
    VK_LCONTROL = &HA2
    VK_RCONTROL = &HA3
    VK_LMENU = &HA4
    VK_RMENU = &HA5
    '
    VK_BROWSER_BACK = &HA6
    VK_BROWSER_FORWARD = &HA7
    VK_BROWSER_REFRESH = &HA8
    VK_BROWSER_STOP = &HA9
    VK_BROWSER_SEARCH = &HAA
    VK_BROWSER_FAVORITES = &HAB
    VK_BROWSER_HOME = &HAC
    '
    VK_VOLUME_MUTE = &HAD
    VK_VOLUME_DOWN = &HAE
    VK_VOLUME_UP = &HAF
    VK_MEDIA_NEXT_TRACK = &HB0
    VK_MEDIA_PREV_TRACK = &HB1
    VK_MEDIA_STOP = &HB2
    VK_MEDIA_PLAY_PAUSE = &HB3
    VK_LAUNCH_MAIL = &HB4
    VK_LAUNCH_MEDIA_SELECT = &HB5
    VK_LAUNCH_APP1 = &HB6
    VK_LAUNCH_APP2 = &HB7

    VK_OEM_1 = &HBA



    End Enum
    End Class
    End Namespace
    Public Class Form1
    <DllImport("user32.dll")> _
    Public Shared Function GetKeyboardState(ByVal keystate As Byte()) As Integer
    End Function
    Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
    Dim keys__1 As Byte() = New Byte(254) {}

    GetKeyboardState(keys__1)

    If keys__1(CInt(Keys.Up)) = 129 AndAlso keys__1(CInt(Keys.Right)) = 129 Then
    Console.WriteLine("Up Arrow key and Right Arrow key down at the same time")
    End If
    End Sub
    End Class
    [/php]


    Last edited by NextGen1; 03-07-2010 at 10:51 PM.


     


     


     



    The Most complete application MPGH will ever offer - 68%




  3. #3
    zmansquared's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Location
    Kickin it at Microsoft
    Posts
    2,086
    Reputation
    36
    Thanks
    221
    My Mood
    Cheerful
    I am lost, sorry. What do i do from there
    Need Help With Coding or Something??? MSN me
    zmansquared@hotmail.com


    I am the one and only Microsoft Fag!!!

    Quote:
    Originally Posted by Arhk
    All games should be hacked, if we don't do it someone else will. Hackers force the progress, of better programming methods.
    ~


    Take this Pic everyone!



    next-

Similar Threads

  1. Disabling The Alt + f4 Hotkey [Close Button]
    By nathanael890 in forum Visual Basic Programming
    Replies: 10
    Last Post: 02-14-2010, 02:59 PM
  2. Hotkeys in C++
    By Dave84311 in forum C++/C Programming
    Replies: 7
    Last Post: 09-07-2007, 07:13 AM
  3. Them buttons?
    By OutZida in forum Art & Graphic Design
    Replies: 2
    Last Post: 02-06-2006, 04:55 AM
  4. Banner/Button for advertising
    By Dave84311 in forum Help & Requests
    Replies: 17
    Last Post: 01-27-2006, 08:59 AM