Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "VK" in [All]

user32

.

static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey);

.

    Shared Function GetAsyncKeyState(ByVal vKey As System.Windows.Forms.Keys) As Short

.

Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Integer) As Short

.

VKs

.

This works not for keyboard only, for mouse also (VK_RBUTTON, VK_LBUTTON).

.

    private static extern short GetAsyncKeyState(System.Windows.Forms.Keys vKey); // Keys enumeration

.

    private static extern short GetAsyncKeyState(System.Int32 vKey);

.

    static extern ushort GetAsyncKeyState(int vKey);

.

    public static bool IsKeyPushedDown(System.Windows.Forms.Keys vKey) {

.

        return 0 != (GetAsyncKeyState((int)vKey) & 0x8000);

.

     Shared Function GetAsyncKeyState(ByVal vKey As System.Windows.Forms.Keys) As Short

.

                VK_LBUTTON = 0x01,

.

                VK_RBUTTON = 0x02,

.

                VK_CANCEL = 0x03,

.

                VK_MBUTTON = 0x04,

.

                VK_XBUTTON1 = 0x05,

.

                VK_XBUTTON2 = 0x06,

.

                VK_BACK = 0x08,

.

                VK_TAB = 0x09,

.

                VK_CLEAR = 0x0C,

.

                VK_RETURN = 0x0D,

.

                VK_SHIFT = 0x10,

.

                VK_CONTROL = 0x11,

.

                VK_MENU = 0x12,

.

                VK_PAUSE = 0x13,

.

                VK_CAPITAL = 0x14,

.

                VK_KANA = 0x15,

.

                VK_HANGEUL = 0x15, /* old name - should be here for compatibility */

.

                VK_HANGUL = 0x15,

.

                VK_JUNJA = 0x17,

.

                VK_FINAL = 0x18,

.

                VK_HANJA = 0x19,

.

                VK_KANJI = 0x19,

.

                VK_ESCAPE = 0x1B,

.

                VK_CONVERT = 0x1C,

.

                VK_NONCONVERT = 0x1D,

.

                VK_ACCEPT = 0x1E,

.

                VK_MODECHANGE = 0x1F,

.

                VK_SPACE = 0x20,

.

                VK_PRIOR = 0x21,

.

                VK_NEXT = 0x22,

.

                VK_END = 0x23,

.

                VK_HOME = 0x24,

.

                VK_LEFT = 0x25,

.

                VK_UP = 0x26,

.

                VK_RIGHT = 0x27,

.

                VK_DOWN = 0x28,

.

                VK_SELECT = 0x29,

.

                VK_PRINT = 0x2A,

.

                VK_EXECUTE = 0x2B,

.

                VK_SNAPSHOT = 0x2C,

.

                VK_INSERT = 0x2D,

.

                VK_DELETE = 0x2E,

.

                VK_HELP = 0x2F,

.

                VK_LWIN = 0x5B,

.

                VK_RWIN = 0x5C,

.

                VK_APPS = 0x5D,

.

                VK_SLEEP = 0x5F,

.

                VK_NUMPAD0 = 0x60,

.

                VK_NUMPAD1 = 0x61,

.

                VK_NUMPAD2 = 0x62,

.

                VK_NUMPAD3 = 0x63,

.

                VK_NUMPAD4 = 0x64,

.

                VK_NUMPAD5 = 0x65,

.

                VK_NUMPAD6 = 0x66,

.

                VK_NUMPAD7 = 0x67,

.

                VK_NUMPAD8 = 0x68,

.

                VK_NUMPAD9 = 0x69,

.

                VK_MULTIPLY = 0x6A,

.

                VK_ADD = 0x6B,

.

                VK_SEPARATOR = 0x6C,

.

                VK_SUBTRACT = 0x6D,

.

                VK_DECIMAL = 0x6E,

.

                VK_DIVIDE = 0x6F,

.

                VK_F1 = 0x70,

.

                VK_F2 = 0x71,

.

                VK_F3 = 0x72,

.

                VK_F4 = 0x73,

.

                VK_F5 = 0x74,

.

                VK_F6 = 0x75,

.

                VK_F7 = 0x76,

.

                VK_F8 = 0x77,

.

                VK_F9 = 0x78,

.

                VK_F10 = 0x79,

.

                VK_F11 = 0x7A,

.

                VK_F12 = 0x7B,

.

                VK_F13 = 0x7C,

.

                VK_F14 = 0x7D,

.

                VK_F15 = 0x7E,

.

                VK_F16 = 0x7F,

.

                VK_F17 = 0x80,

.

                VK_F18 = 0x81,

.

                VK_F19 = 0x82,

.

                VK_F20 = 0x83,

.

                VK_F21 = 0x84,

.

                VK_F22 = 0x85,

.

                VK_F23 = 0x86,

.

                VK_F24 = 0x87,

.

                VK_NUMLOCK = 0x90,

.

                VK_SCROLL = 0x91,

.

                VK_OEM_NEC_EQUAL = 0x92, // '=' key on numpad

.

                VK_OEM_FJ_JISHO = 0x92, // 'Dictionary' key

.

                VK_OEM_FJ_MASSHOU = 0x93, // 'Unregister word' key

.

                VK_OEM_FJ_TOUROKU = 0x94, // 'Register word' key

.

                VK_OEM_FJ_LOYA = 0x95, // 'Left OYAYUBI' key

.

                VK_OEM_FJ_ROYA = 0x96, // 'Right OYAYUBI' key

.

                VK_LSHIFT = 0xA0,

.

                VK_RSHIFT = 0xA1,

.

                VK_LCONTROL = 0xA2,

.

                VK_RCONTROL = 0xA3,

.

                VK_LMENU = 0xA4,

.

                VK_RMENU = 0xA5,

.

                VK_BROWSER_BACK = 0xA6,

.

                VK_BROWSER_FORWARD = 0xA7,

.

                VK_BROWSER_REFRESH = 0xA8,

.

                VK_BROWSER_STOP = 0xA9,

.

                VK_BROWSER_SEARCH = 0xAA,

.

                VK_BROWSER_FAVORITES = 0xAB,

.

                VK_BROWSER_HOME = 0xAC,

.

                VK_VOLUME_MUTE = 0xAD,

.

                VK_VOLUME_DOWN = 0xAE,

.

                VK_VOLUME_UP = 0xAF,

.

                VK_MEDIA_NEXT_TRACK = 0xB0,

.

                VK_MEDIA_PREV_TRACK = 0xB1,

.

                VK_MEDIA_STOP = 0xB2,

.

                VK_MEDIA_PLAY_PAUSE = 0xB3,

.

                VK_LAUNCH_MAIL = 0xB4,

.

                VK_LAUNCH_MEDIA_SELECT = 0xB5,

.

                VK_LAUNCH_APP1 = 0xB6,

.

                VK_LAUNCH_APP2 = 0xB7,

.

                VK_OEM_1 = 0xBA, // ';:' for US

.

                VK_OEM_PLUS = 0xBB, // '+' any country

.

                VK_OEM_COMMA = 0xBC, // ',' any country

.

                VK_OEM_MINUS = 0xBD, // '-' any country

.

                VK_OEM_PERIOD = 0xBE, // '.' any country

.

                VK_OEM_2 = 0xBF, // '/?' for US

.

                VK_OEM_3 = 0xC0, // '`~' for US

.

                VK_OEM_4 = 0xDB, // '[{' for US

.

                VK_OEM_5 = 0xDC, // '\|' for US

.

                VK_OEM_6 = 0xDD, // ']}' for US

.

                VK_OEM_7 = 0xDE, // ''"' for US

.

                VK_OEM_8 = 0xDF,

.

                VK_OEM_AX = 0xE1, // 'AX' key on Japanese AX kbd

.

                VK_OEM_102 = 0xE2, // "<>" or "\|" on RT 102-key kbd.

.

                VK_ICO_HELP = 0xE3, // Help key on ICO

.

                VK_ICO_00 = 0xE4, // 00 key on ICO

.

                VK_PROCESSKEY = 0xE5,

.

                VK_ICO_CLEAR = 0xE6,

.

                VK_PACKET = 0xE7,

.

                VK_OEM_RESET = 0xE9,

.

                VK_OEM_JUMP = 0xEA,

.

                VK_OEM_PA1 = 0xEB,

.

                VK_OEM_PA2 = 0xEC,

.

                VK_OEM_PA3 = 0xED,

.

                VK_OEM_WSCTRL = 0xEE,

.

                VK_OEM_CUSEL = 0xEF,

.

                VK_OEM_ATTN = 0xF0,

.

                VK_OEM_FINISH = 0xF1,

.

                VK_OEM_COPY = 0xF2,

.

                VK_OEM_AUTO = 0xF3,

.

                VK_OEM_ENLW = 0xF4,

.

                VK_OEM_BACKTAB = 0xF5,

.

                VK_ATTN = 0xF6,

.

                VK_CRSEL = 0xF7,

.

                VK_EXSEL = 0xF8,

.

                VK_EREOF = 0xF9,

.

                VK_PLAY = 0xFA,

.

                VK_ZOOM = 0xFB,

.

                VK_NONAME = 0xFC,

.

                VK_PA1 = 0xFD,

.

                VK_OEM_CLEAR = 0xFE

.

VK

.

    VK_LBUTTON       = 0x01,

.

    VK_RBUTTON       = 0x02,

.

    VK_CANCEL    = 0x03,

.

    VK_MBUTTON       = 0x04,

.

    VK_XBUTTON1      = 0x05,

.

    VK_XBUTTON2      = 0x06,

.

    VK_BACK      = 0x08,

.

    VK_TAB       = 0x09,

.

    VK_CLEAR     = 0x0C,

.

    VK_RETURN    = 0x0D,

.

    VK_SHIFT     = 0x10,

.

    VK_CONTROL       = 0x11,

.

    VK_MENU      = 0x12,

.

    VK_PAUSE     = 0x13,

.

    VK_CAPITAL       = 0x14,

.

    VK_KANA      = 0x15,

.

    VK_HANGEUL       = 0x15,  /* old name - should be here for compatibility */

.

    VK_HANGUL    = 0x15,

.

    VK_JUNJA     = 0x17,

.

    VK_FINAL     = 0x18,

.

    VK_HANJA     = 0x19,

.

    VK_KANJI     = 0x19,

.

    VK_ESCAPE    = 0x1B,

.

    VK_CONVERT       = 0x1C,

.

    VK_NONCONVERT    = 0x1D,

.

    VK_ACCEPT    = 0x1E,

.

    VK_MODECHANGE    = 0x1F,

.

    VK_SPACE     = 0x20,

.

    VK_PRIOR     = 0x21,

.

    VK_NEXT      = 0x22,

.

    VK_END       = 0x23,

.

    VK_HOME      = 0x24,

.

    VK_LEFT      = 0x25,

.

    VK_UP        = 0x26,

.

    VK_RIGHT     = 0x27,

.

    VK_DOWN      = 0x28,

.

    VK_SELECT    = 0x29,

.

    VK_PRINT     = 0x2A,

.

    VK_EXECUTE       = 0x2B,

.

    VK_SNAPSHOT      = 0x2C,

.

    VK_INSERT    = 0x2D,

.

    VK_DELETE    = 0x2E,

.

    VK_HELP      = 0x2F,

.

    VK_LWIN      = 0x5B,

.

    VK_RWIN      = 0x5C,

.

    VK_APPS      = 0x5D,

.

    VK_SLEEP     = 0x5F,

.

    VK_NUMPAD0       = 0x60,

.

    VK_NUMPAD1       = 0x61,

.

    VK_NUMPAD2       = 0x62,

.

    VK_NUMPAD3       = 0x63,

.

    VK_NUMPAD4       = 0x64,

.

    VK_NUMPAD5       = 0x65,

.

    VK_NUMPAD6       = 0x66,

.

    VK_NUMPAD7       = 0x67,

.

    VK_NUMPAD8       = 0x68,

.

    VK_NUMPAD9       = 0x69,

.

    VK_MULTIPLY      = 0x6A,

.

    VK_ADD       = 0x6B,

.

    VK_SEPARATOR     = 0x6C,

.

    VK_SUBTRACT      = 0x6D,

.

    VK_DECIMAL       = 0x6E,

.

    VK_DIVIDE    = 0x6F,

.

    VK_F1        = 0x70,

.

    VK_F2        = 0x71,

.

    VK_F3        = 0x72,

.

    VK_F4        = 0x73,

.

    VK_F5        = 0x74,

.

    VK_F6        = 0x75,

.

    VK_F7        = 0x76,

.

    VK_F8        = 0x77,

.

    VK_F9        = 0x78,

.

    VK_F10       = 0x79,

.

    VK_F11       = 0x7A,

.

    VK_F12       = 0x7B,

.

    VK_F13       = 0x7C,

.

    VK_F14       = 0x7D,

.

    VK_F15       = 0x7E,

.

    VK_F16       = 0x7F,

.

    VK_F17       = 0x80,

.

    VK_F18       = 0x81,

.

    VK_F19       = 0x82,

.

    VK_F20       = 0x83,

.

    VK_F21       = 0x84,

.

    VK_F22       = 0x85,

.

    VK_F23       = 0x86,

.

    VK_F24       = 0x87,

.

    VK_NUMLOCK       = 0x90,

.

    VK_SCROLL    = 0x91,

.

    VK_OEM_NEC_EQUAL = 0x92,   // '=' key on numpad

.

    VK_OEM_FJ_JISHO  = 0x92,   // 'Dictionary' key

.

    VK_OEM_FJ_MASSHOU= 0x93,   // 'Unregister word' key

.

    VK_OEM_FJ_TOUROKU= 0x94,   // 'Register word' key

.

    VK_OEM_FJ_LOYA   = 0x95,   // 'Left OYAYUBI' key

.

    VK_OEM_FJ_ROYA   = 0x96,   // 'Right OYAYUBI' key

.

    VK_LSHIFT    = 0xA0,

.

    VK_RSHIFT    = 0xA1,

.

    VK_LCONTROL      = 0xA2,

.

    VK_RCONTROL      = 0xA3,

.

    VK_LMENU     = 0xA4,

.

    VK_RMENU     = 0xA5,

.

    VK_BROWSER_BACK       = 0xA6,

.

    VK_BROWSER_FORWARD    = 0xA7,

.

    VK_BROWSER_REFRESH    = 0xA8,

.

    VK_BROWSER_STOP       = 0xA9,

.

    VK_BROWSER_SEARCH     = 0xAA,

.

    VK_BROWSER_FAVORITES  = 0xAB,

.

    VK_BROWSER_HOME       = 0xAC,

.

    VK_VOLUME_MUTE    = 0xAD,

.

    VK_VOLUME_DOWN    = 0xAE,

.

    VK_VOLUME_UP      = 0xAF,

.

    VK_MEDIA_NEXT_TRACK   = 0xB0,

.

    VK_MEDIA_PREV_TRACK   = 0xB1,

.

    VK_MEDIA_STOP     = 0xB2,

.

    VK_MEDIA_PLAY_PAUSE   = 0xB3,

.

    VK_LAUNCH_MAIL    = 0xB4,

.

    VK_LAUNCH_MEDIA_SELECT= 0xB5,

.

    VK_LAUNCH_APP1    = 0xB6,

.

    VK_LAUNCH_APP2    = 0xB7,

.

    VK_OEM_1     = 0xBA,   // ';:' for US

.

    VK_OEM_PLUS      = 0xBB,   // '+' any country

.

    VK_OEM_COMMA     = 0xBC,   // ',' any country

.

    VK_OEM_MINUS     = 0xBD,   // '-' any country

.

    VK_OEM_PERIOD    = 0xBE,   // '.' any country

.

    VK_OEM_2     = 0xBF,   // '/?' for US

.

    VK_OEM_3     = 0xC0,   // '`~' for US

.

    VK_OEM_4     = 0xDB,  //  '[{' for US

.

    VK_OEM_5     = 0xDC,  //  '\|' for US

.

    VK_OEM_6     = 0xDD,  //  ']}' for US

.

    VK_OEM_7     = 0xDE,  //  ''"' for US

.

    VK_OEM_8     = 0xDF,

.

    VK_OEM_AX    = 0xE1,  //  'AX' key on Japanese AX kbd

.

    VK_OEM_102       = 0xE2,  //  "<>" or "\|" on RT 102-key kbd.

.

    VK_ICO_HELP      = 0xE3,  //  Help key on ICO

.

    VK_ICO_00    = 0xE4,  //  00 key on ICO

.

    VK_PROCESSKEY    = 0xE5,

.

    VK_ICO_CLEAR     = 0xE6,

.

    VK_PACKET    = 0xE7,

.

    VK_OEM_RESET     = 0xE9,

.

    VK_OEM_JUMP      = 0xEA,

.

    VK_OEM_PA1       = 0xEB,

.

    VK_OEM_PA2       = 0xEC,

.

    VK_OEM_PA3       = 0xED,

.

    VK_OEM_WSCTRL    = 0xEE,

.

    VK_OEM_CUSEL     = 0xEF,

.

    VK_OEM_ATTN      = 0xF0,

.

    VK_OEM_FINISH    = 0xF1,

.

    VK_OEM_COPY      = 0xF2,

.

    VK_OEM_AUTO      = 0xF3,

.

    VK_OEM_ENLW      = 0xF4,

.

    VK_OEM_BACKTAB   = 0xF5,

.

    VK_ATTN      = 0xF6,

.

    VK_CRSEL     = 0xF7,

.

    VK_EXSEL     = 0xF8,

.

    VK_EREOF     = 0xF9,

.

    VK_PLAY      = 0xFA,

.

    VK_ZOOM      = 0xFB,

.

    VK_NONAME    = 0xFC,

.

    VK_PA1       = 0xFD,

.

    VK_OEM_CLEAR     = 0xFE

.

    return Convert.ToBoolean(GetKeyState(VirtualKeyStates.VK_LBUTTON) & KEY_PRESSED);

.

The VirtualKeys (they're just mapped to the VK_* constants) and WindowsMessages enumeration have been omitted as it's quite lengthy.

.

static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,

.

static extern void keybd_event(byte bVk, byte bScan, uint dwFlags,

.

Private Shared Sub keybd_event(bVk As Byte, bScan As Byte, dwFlags As UInteger, dwExtraInfo As UIntPtr)

.

Private Shared Sub keybd_event(bVk As Byte, bScan As Byte, dwFlags As UInteger, dwExtraInfo As Integer)

.

Public Shared Sub keybd_event(ByVal bVk As Byte, ByVal bScan As Byte, _

.

Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

.

VKs

.

(see also VkKeyScan):

.

     const byte VK_RETURN = 0x0D;

.

     private static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);

.

         keybd_event(VK_RETURN, 0, 0, 0);

.

         keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0);

.

     Const VK_RETURN As Byte = &HD '0x0D

.

     Private Shared Sub keybd_event(ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As UInteger, ByVal dwExtraInfo As Integer)

.

     'Public Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

.

     keybd_event(VK_RETURN, 0, 0, 0)

.

     keybd_event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0)

.

    Public Shared Sub keybd_event(ByVal bVk As Byte, ByVal bScan As Byte, _

.

        Const VK_SCROLL As Byte = &H91

.

        keybd_event(VK_SCROLL, 0x45, 0, 0)               ' Generates a KEY_DOWN

.

        keybd_event(VK_SCROLL, 0x45, KEYEVENTF_KEYUP, 0) ' Generates a KEY_UP

.

    public const byte VK_LSHIFT= 0xA0; // left shift key

.

    public const byte VK_TAB = 0x09;

.

    keybd_event(VK_LSHIFT, 0x45, 0, 0);

.

    keybd_event(VK_TAB, 0x45, 0, 0);

.

    keybd_event(VK_TAB, 0x45, KEYEVENTF_KEYUP, 0);

.

    keybd_event(VK_LSHIFT, 0x45, KEYEVENTF_KEYUP, 0);

.

    static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, UIntPtr dwExtraInfo);

.

const uint MAPVK_VK_TO_VSC = 0x00;

.

const uint MAPVK_VSC_TO_VK = 0x01;

.

const uint MAPVK_VK_TO_CHAR = 0x02;

.

const uint MAPVK_VSC_TO_VK_EX = 0x03;

.

const uint MAPVK_VK_TO_VSC_EX = 0x04;

.

     MAPVK_VK_TO_VSC = 0x00,

.

     MAPVK_VSC_TO_VK = 0x01,

.

     MAPVK_VK_TO_CHAR = 0x02,

.

     MAPVK_VSC_TO_VK_EX = 0x03,

.

     MAPVK_VK_TO_VSC_EX = 0x04

.

const uint MAPVK_VK_TO_VSC = 0x00;

.

const uint MAPVK_VSC_TO_VK = 0x01;

.

const uint MAPVK_VK_TO_CHAR = 0x02;

.

const uint MAPVK_VSC_TO_VK_EX = 0x03;

.

const uint MAPVK_VK_TO_VSC_EX = 0x04;

.

     MAPVK_VK_TO_VSC = 0x00,

.

     MAPVK_VSC_TO_VK = 0x01,

.

     MAPVK_VK_TO_CHAR = 0x02,

.

     MAPVK_VSC_TO_VK_EX = 0x03,

.

     MAPVK_VK_TO_VSC_EX = 0x04

.

        wVk = EnumLib.VirtualKeyShort.KEY_S

.

        wVk = EnumLib.VirtualKeyShort.KEY_S,

.

        wVk = EnumLib.VirtualKeyShort.KEY_S

.

        wVk = EnumLib.VirtualKeyShort.KEY_S,

.

        wVk = EnumLib.VirtualKeyShort.KEY_S

.

        wVk = EnumLib.VirtualKeyShort.KEY_S,

.

   $_inputList.Add( $( New-Object Testing.Windows3+INPUT -Property @{ type = [Testing.Windows3+INPUT_TYPE]::KEYBOARD ; U = $( New-Object Testing.Windows3+InputUnion -Property @{ ki = $( New-Object Testing.Windows3+KEYBDINPUT -Property @{ wVk = [Testing.Windows3+VirtualKeyShort]::KEY_S } ) } ) } ) )

.

   $_inputList.Add( $( New-Object Testing.Windows3+INPUT -Property @{ type = [Testing.Windows3+INPUT_TYPE]::KEYBOARD ; U = $( New-Object Testing.Windows3+InputUnion -Property @{ ki = $( New-Object Testing.Windows3+KEYBDINPUT -Property @{ wVk = [Testing.Windows3+VirtualKeyShort]::KEY_S ; dwFlags = $( [Testing.Windows3+KEYEVENTF]::KEYUP ) } ) } ) } ) )

.

   $_inputList.Add( $( New-Object Testing.Windows3+INPUT -Property @{ type = [Testing.Windows3+INPUT_TYPE]::KEYBOARD ; U = $( New-Object Testing.Windows3+InputUnion -Property @{ ki = $( New-Object Testing.Windows3+KEYBDINPUT -Property @{ wVk = [Testing.Windows3+VirtualKeyShort]::MENU  } ) } ) } ) )

.

   $_inputList.Add( $( New-Object Testing.Windows3+INPUT -Property @{ type = [Testing.Windows3+INPUT_TYPE]::KEYBOARD ; U = $( New-Object Testing.Windows3+InputUnion -Property @{ ki = $( New-Object Testing.Windows3+KEYBDINPUT -Property @{ wVk = [Testing.Windows3+VirtualKeyShort]::KEY_E } ) } ) } ) )

.

   $_inputList.Add( $( New-Object Testing.Windows3+INPUT -Property @{ type = [Testing.Windows3+INPUT_TYPE]::KEYBOARD ; U = $( New-Object Testing.Windows3+InputUnion -Property @{ ki = $( New-Object Testing.Windows3+KEYBDINPUT -Property @{ wVk = [Testing.Windows3+VirtualKeyShort]::MENU  ; dwFlags = $( [Testing.Windows3+KEYEVENTF]::KEYUP ) } ) } ) } ) )

.

   $_inputList.Add( $( New-Object Testing.Windows3+INPUT -Property @{ type = [Testing.Windows3+INPUT_TYPE]::KEYBOARD ; U = $( New-Object Testing.Windows3+InputUnion -Property @{ ki = $( New-Object Testing.Windows3+KEYBDINPUT -Property @{ wVk = [Testing.Windows3+VirtualKeyShort]::KEY_E ; dwFlags = $( [Testing.Windows3+KEYEVENTF]::KEYUP ) } ) } ) } ) )

.

   $_inputList.Add( $( New-Object Testing.Windows3+INPUT -Property @{ type = [Testing.Windows3+INPUT_TYPE]::KEYBOARD ; U = $( New-Object Testing.Windows3+InputUnion -Property @{ ki = $( New-Object Testing.Windows3+KEYBDINPUT -Property @{ wVk = [Testing.Windows3+VirtualKeyShort]::CONTROL  } ) } ) } ) )

.

   $_inputList.Add( $( New-Object Testing.Windows3+INPUT -Property @{ type = [Testing.Windows3+INPUT_TYPE]::KEYBOARD ; U = $( New-Object Testing.Windows3+InputUnion -Property @{ ki = $( New-Object Testing.Windows3+KEYBDINPUT -Property @{ wVk = [Testing.Windows3+VirtualKeyShort]::KEY_F } ) } ) } ) )

.

   $_inputList.Add( $( New-Object Testing.Windows3+INPUT -Property @{ type = [Testing.Windows3+INPUT_TYPE]::KEYBOARD ; U = $( New-Object Testing.Windows3+InputUnion -Property @{ ki = $( New-Object Testing.Windows3+KEYBDINPUT -Property @{ wVk = [Testing.Windows3+VirtualKeyShort]::CONTROL  ; dwFlags = $( [Testing.Windows3+KEYEVENTF]::KEYUP ) } ) } ) } ) )

.

   $_inputList.Add( $( New-Object Testing.Windows3+INPUT -Property @{ type = [Testing.Windows3+INPUT_TYPE]::KEYBOARD ; U = $( New-Object Testing.Windows3+InputUnion -Property @{ ki = $( New-Object Testing.Windows3+KEYBDINPUT -Property @{ wVk = [Testing.Windows3+VirtualKeyShort]::KEY_F ; dwFlags = $( [Testing.Windows3+KEYEVENTF]::KEYUP ) } ) } ) } ) )

.

    Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)

.

    Const VK_NUMLOCK As Short = &H90S

.

    Const VK_SCROLL As Short = &H91S

.

    Const VK_CAPITAL As Short = &H14S

.

    NumLockState = keys(VK_NUMLOCK)

.

        keys(VK_NUMLOCK) = 1

.

        keybd_event(VK_NUMLOCK, &H45S, KEYEVENTF_EXTENDEDKEY Or 0, 0)

.

        keybd_event(VK_NUMLOCK, &H45S, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)

.

        keys(VK_NUMLOCK) = 0

.

        keybd_event(VK_NUMLOCK, &H45S, KEYEVENTF_EXTENDEDKEY Or 0, 0)

.

        keybd_event(VK_NUMLOCK, &H45S, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)

.

    CapsLockState = keys(VK_CAPITAL)

.

        keys(VK_CAPITAL) = 1

.

        keybd_event(VK_CAPITAL, &H45S, KEYEVENTF_EXTENDEDKEY Or 0, 0)

.

        keybd_event(VK_CAPITAL, &H45S, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)

.

        keys(VK_CAPITAL) = 0

.

        keybd_event(VK_CAPITAL, &H45S, KEYEVENTF_EXTENDEDKEY Or 0, 0)

.

        keybd_event(VK_CAPITAL, &H45S, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)

.

    public static string VKCodeToUnicode(uint VKCode)

.

    uint lScanCode = MapVirtualKey(VKCode,0);

.

    ToUnicodeEx(VKCode, lScanCode, bKeyState, sbString, (int)5, (uint)0, HKL);

.

    public static string VKCodeToUnicode(uint VKCode)

.

    uint lScanCode = MapVirtualKey(VKCode,0);

.

    ToUnicodeEx(VKCode, lScanCode, bKeyState, sbString, (int)5, (uint)0, HKL);

.

        ByVal fsModifier As Integer, ByVal vk As Integer) As Integer

.

Public Const VK_ADD = &H6B

.

Public Const VK_ATTN = &HF6

.

Public Const VK_BACK = &H8 'back space

.

Public Const VK_CANCEL = &H3

.

Public Const VK_CAPITAL = &H14

.

Public Const VK_CLEAR = &HC

.

Public Const VK_CONTROL = &H11 'control

.

Public Const VK_CRSEL = &HF7

.

Public Const VK_DECIMAL = &H6E

.

Public Const VK_DELETE = &H2E 'delete

.

Public Const VK_DIVIDE = &H6F ' /

.

Public Const VK_DOWN = &H28 'arrow

.

Public Const VK_END = &H23 'end

.

Public Const VK_EREOF = &HF9

.

Public Const VK_ESCAPE = &H1B 'esc

.

Public Const VK_EXECUTE = &H2B

.

Public Const VK_EXSEL = &HF8

.

Public Const VK_F1 = &H70 'function keys

.

Public Const VK_F10 = &H79 'function keys

.

Public Const VK_F11 = &H7A 'function keys

.

Public Const VK_F12 = &H7B 'function keys

.

Public Const VK_F13 = &H7C 'function keys

.

Public Const VK_F14 = &H7D 'function keys

.

Public Const VK_F15 = &H7E 'function keys

.

Public Const VK_F16 = &H7F 'function keys

.

Public Const VK_F17 = &H80 'function keys

.

Public Const VK_F18 = &H81 'function keys

.

Public Const VK_F19 = &H82 'function keys

.

Public Const VK_F2 = &H71 'function keys

.

Public Const VK_F20 = &H83 'function keys

.

Public Const VK_F21 = &H84 'function keys

.

Public Const VK_F22 = &H85 'function keys

.

Public Const VK_F23 = &H86 'function keys

.

Public Const VK_F24 = &H87 'function keys

.

Public Const VK_F3 = &H72 'function keys

.

Public Const VK_F4 = &H73 'function keys

.

Public Const VK_F5 = &H74 'function keys

.

Public Const VK_F6 = &H75 'function keys

.

Public Const VK_F7 = &H76 'function keys

.

Public Const VK_F8 = &H77 'function keys

.

Public Const VK_F9 = &H78 'function keys

.

Public Const VK_HELP = &H2F

.

Public Const VK_HOME = &H24 'home

.

Public Const VK_INSERT = &H2D 'insert

.

Public Const VK_LBUTTON = &H1 'left mouse button

.

Public Const VK_LCONTROL = &HA2 'left control

.

Public Const VK_LEFT = &H25 'arrow

.

Public Const VK_LMENU = &HA4

.

Public Const VK_LSHIFT = &HA0 'left shift

.

Public Const VK_MBUTTON = &H4 ' NOT contiguous with L RBUTTON

.

Public Const VK_MENU = &H12

.

Public Const VK_MULTIPLY = &H6A ' *

.

Public Const VK_NEXT = &H22

.

Public Const VK_NONAME = &HFC

.

Public Const VK_NUMLOCK = &H90 'numlock(use toggle)

.

Public Const VK_NUMPAD0 = &H60

.

Public Const VK_NUMPAD1 = &H61

.

Public Const VK_NUMPAD2 = &H62

.

Public Const VK_NUMPAD3 = &H63

.

Public Const VK_NUMPAD4 = &H64

.

Public Const VK_NUMPAD5 = &H65

.

Public Const VK_NUMPAD6 = &H66

.

Public Const VK_NUMPAD7 = &H67

.

Public Const VK_NUMPAD8 = &H68

.

Public Const VK_NUMPAD9 = &H69

.

Public Const VK_OEM_CLEAR = &HFE

.

Public Const VK_PA1 = &HFD

.

Public Const VK_PAUSE = &H13 'break/pause

.

Public Const VK_PLAY = &HFA

.

Public Const VK_PRINT = &H2A 'print screen

.

Public Const VK_PRIOR = &H21

.

Public Const VK_PROCESSKEY = &HE5

.

Public Const VK_RBUTTON = &H2 'right mouse button

.

Public Const VK_RCONTROL = &HA3 'right control

.

Public Const VK_RETURN = &HD 'return/enter

.

Public Const VK_RIGHT = &H27 'arrow

.

Public Const VK_RMENU = &HA5

.

Public Const VK_RSHIFT = &HA1 'right shift

.

Public Const VK_SCROLL = &H91

.

Public Const VK_SELECT = &H29

.

Public Const VK_SEPARATOR = &H6C

.

Public Const VK_SHIFT = &H10 'shift

.

Public Const VK_SNAPSHOT = &H2C

.

Public Const VK_SPACE = &H20 'space bar

.

Public Const VK_SUBTRACT = &H6D ' -

.

Public Const VK_TAB = &H9 'Tab button

.

Public Const VK_UP = &H26 'arrow

.

Public Const VK_ZOOM = &HFB

.

original de http://herman.eldering.net/vb/vkeycnst.htm

.

    public const uint VK_LBUTTON = 0x01;

.

    public const uint VK_RBUTTON = 0x02;

.

    public const uint VK_CANCEL = 0x03;

.

    public const uint VK_MBUTTON = 0x04;    /* NOT contiguous with L & RBUTTON */

.

    public const uint VK_XBUTTON1 = 0x05;    /* NOT contiguous with L & RBUTTON */

.

    public const uint VK_XBUTTON2 = 0x06;    /* NOT contiguous with L & RBUTTON */

.

    public const uint VK_BACK = 0x08;

.

    public const uint VK_TAB = 0x09;

.

    public const uint VK_CLEAR = 0x0C;

.

    public const uint VK_RETURN = 0x0D;

.

    public const uint VK_SHIFT = 0x10;

.

    public const uint VK_CONTROL = 0x11;

.

    public const uint VK_MENU = 0x12;

.

    public const uint VK_PAUSE = 0x13;

.

    public const uint VK_CAPITAL = 0x14;

.

    public const uint VK_KANA = 0x15;

.

    public const uint VK_HANGEUL = 0x15;  /* old name - should be here for compatibility */

.

    public const uint VK_HANGUL = 0x15;

.

    public const uint VK_JUNJA = 0x17;

.

    public const uint VK_FINAL = 0x18;

.

    public const uint VK_HANJA = 0x19;

.

    public const uint VK_KANJI = 0x19;

.

    public const uint VK_ESCAPE = 0x1B;

.

    public const uint VK_CONVERT = 0x1C;

.

    public const uint VK_NONCONVERT = 0x1D;

.

    public const uint VK_ACCEPT = 0x1E;

.

    public const uint VK_MODECHANGE = 0x1F;

.

    public const uint VK_SPACE = 0x20;

.

    public const uint VK_PRIOR = 0x21;

.

    public const uint VK_NEXT = 0x22;

.

    public const uint VK_END = 0x23;

.

    public const uint VK_HOME = 0x24;

.

    public const uint VK_LEFT = 0x25;

.

    public const uint VK_UP = 0x26;

.

    public const uint VK_RIGHT = 0x27;

.

    public const uint VK_DOWN = 0x28;

.

    public const uint VK_SELECT = 0x29;

.

    public const uint VK_PRINT = 0x2A;

.

    public const uint VK_EXECUTE = 0x2B;

.

    public const uint VK_SNAPSHOT = 0x2C;

.

    public const uint VK_INSERT = 0x2D;

.

    public const uint VK_DELETE = 0x2E;

.

    public const uint VK_HELP = 0x2F;

.

    public const uint VK_LWIN = 0x5B;CII '0' - '9' (0x30 - 0x39)

. * VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A) .

    public const uint VK_LWIN = 0x5B;

.

    public const uint VK_RWIN = 0x5C;

.

    public const uint VK_APPS = 0x5D;

.

    public const uint VK_SLEEP = 0x5F;

.

    public const uint VK_NUMPAD0 = 0x60;

.

    public const uint VK_NUMPAD1 = 0x61;

.

    public const uint VK_NUMPAD2 = 0x62;

.

    public const uint VK_NUMPAD3 = 0x63;

.

    public const uint VK_NUMPAD4 = 0x64;

.

    public const uint VK_NUMPAD5 = 0x65;

.

    public const uint VK_NUMPAD6 = 0x66;

.

    public const uint VK_NUMPAD7 = 0x67;

.

    public const uint VK_NUMPAD8 = 0x68;

.

    public const uint VK_NUMPAD9 = 0x69;

.

    public const uint VK_MULTIPLY = 0x6A;

.

    public const uint VK_ADD = 0x6B;

.

    public const uint VK_SEPARATOR = 0x6C;

.

    public const uint VK_SUBTRACT = 0x6D;

.

    public const uint VK_DECIMAL = 0x6E;

.

    public const uint VK_DIVIDE = 0x6F;

.

    public const uint VK_F1 = 0x70;

.

    public const uint VK_F2 = 0x71;

.

    public const uint VK_F3 = 0x72;

.

    public const uint VK_F4 = 0x73;

.

    public const uint VK_F5 = 0x74;

.

    public const uint VK_F6 = 0x75;

.

    public const uint VK_F7 = 0x76;

.

    public const uint VK_F8 = 0x77;

.

    public const uint VK_F9 = 0x78;

.

    public const uint VK_F10 = 0x79;

.

    public const uint VK_F11 = 0x7A;

.

    public const uint VK_F12 = 0x7B;

.

    public const uint VK_F13 = 0x7C;

.

    public const uint VK_F14 = 0x7D;

.

    public const uint VK_F15 = 0x7E;

.

    public const uint VK_F16 = 0x7F;

.

    public const uint VK_F17 = 0x80;

.

    public const uint VK_F18 = 0x81;

.

    public const uint VK_F19 = 0x82;

.

    public const uint VK_F20 = 0x83;

.

    public const uint VK_F21 = 0x84;

.

    public const uint VK_F22 = 0x85;

.

    public const uint VK_F23 = 0x86;

.

    public const uint VK_F24 = 0x87;

.

    public const uint VK_NUMLOCK = 0x90;

.

    public const uint VK_SCROLL = 0x91;

.

    public const uint VK_OEM_NEC_EQUAL = 0x92;   // '=' key on numpad

.

    public const uint VK_OEM_FJ_JISHO = 0x92;   // 'Dictionary' key

.

    public const uint VK_OEM_FJ_MASSHOU = 0x93;   // 'Unregister word' key

.

    public const uint VK_OEM_FJ_TOUROKU = 0x94;   // 'Register word' key

.

    public const uint VK_OEM_FJ_LOYA = 0x95;   // 'Left OYAYUBI' key

.

    public const uint VK_OEM_FJ_ROYA = 0x96;   // 'Right OYAYUBI' key

. * VK_L* & VK_R* - left and right Alt, Ctrl and Shift virtual keys. .

    public const uint VK_LSHIFT = 0xA0;

.

    public const uint VK_RSHIFT = 0xA1;

.

    public const uint VK_LCONTROL = 0xA2;

.

    public const uint VK_RCONTROL = 0xA3;

.

    public const uint VK_LMENU = 0xA4;

.

    public const uint VK_RMENU = 0xA5;

.

    public const uint VK_BROWSER_BACK = 0xA6;

.

    public const uint VK_BROWSER_FORWARD = 0xA7;

.

    public const uint VK_BROWSER_REFRESH = 0xA8;

.

    public const uint VK_BROWSER_STOP = 0xA9;

.

    public const uint VK_BROWSER_SEARCH = 0xAA;

.

    public const uint VK_BROWSER_FAVORITES = 0xAB;

.

    public const uint VK_BROWSER_HOME = 0xAC;

.

    public const uint VK_VOLUME_MUTE = 0xAD;

.

    public const uint VK_VOLUME_DOWN = 0xAE;

.

    public const uint VK_VOLUME_UP = 0xAF;

.

    public const uint VK_MEDIA_NEXT_TRACK = 0xB0;

.

    public const uint VK_MEDIA_PREV_TRACK = 0xB1;

.

    public const uint VK_MEDIA_STOP = 0xB2;

.

    public const uint VK_MEDIA_PLAY_PAUSE = 0xB3;

.

    public const uint VK_LAUNCH_MAIL = 0xB4;

.

    public const uint VK_LAUNCH_MEDIA_SELECT = 0xB5;

.

    public const uint VK_LAUNCH_APP1 = 0xB6;

.

    public const uint VK_LAUNCH_APP2 = 0xB7;

.

    public const uint VK_OEM_1 = 0xBA;   // ';:' for US

.

    public const uint VK_OEM_PLUS = 0xBB;   // '+' any country

.

    public const uint VK_OEM_COMMA = 0xBC;   // ',' any country

.

    public const uint VK_OEM_MINUS = 0xBD;   // '-' any country

.

    public const uint VK_OEM_PERIOD = 0xBE;   // '.' any country

.

    public const uint VK_OEM_2 = 0xBF;   // '/?' for US

.

    public const uint VK_OEM_3 = 0xC0;   // '`~' for US

.

    public const uint VK_OEM_4 = 0xDB;  //  '[{' for US

.

    public const uint VK_OEM_5 = 0xDC;  //  '\|' for US

.

    public const uint VK_OEM_6 = 0xDD;  //  ']}' for US

.

    public const uint VK_OEM_7 = 0xDE;  //  ''"' for US

.

    public const uint VK_OEM_8 = 0xDF;

.

    public const uint VK_OEM_AX = 0xE1;  //  'AX' key on Japanese AX kbd

.

    public const uint VK_OEM_102 = 0xE2;  //  "<>" or "\|" on RT 102-key kbd.

.

    public const uint VK_ICO_HELP = 0xE3;  //  Help key on ICO

.

    public const uint VK_ICO_00 = 0xE4;  //  00 key on ICO

.

    public const uint VK_PROCESSKEY = 0xE5;

.

    public const uint VK_ICO_CLEAR = 0xE6;

.

    public const uint VK_PACKET = 0xE7;

.

    public const uint VK_OEM_RESET = 0xE9;

.

    public const uint VK_OEM_JUMP = 0xEA;

.

    public const uint VK_OEM_PA1 = 0xEB;

.

    public const uint VK_OEM_PA2 = 0xEC;

.

    public const uint VK_OEM_PA3 = 0xED;

.

    public const uint VK_OEM_WSCTRL = 0xEE;

.

    public const uint VK_OEM_CUSEL = 0xEF;

.

    public const uint VK_OEM_ATTN = 0xF0;

.

    public const uint VK_OEM_FINISH = 0xF1;

.

    public const uint VK_OEM_COPY = 0xF2;

.

    public const uint VK_OEM_AUTO = 0xF3;

.

    public const uint VK_OEM_ENLW = 0xF4;

.

    public const uint VK_OEM_BACKTAB = 0xF5;

.

    public const uint VK_ATTN = 0xF6;

.

    public const uint VK_CRSEL = 0xF7;

.

    public const uint VK_EXSEL = 0xF8;

.

    public const uint VK_EREOF = 0xF9;

.

    public const uint VK_PLAY = 0xFA;

.

    public const uint VK_ZOOM = 0xFB;

.

    public const uint VK_NONAME = 0xFC;

.

    public const uint VK_PA1 = 0xFD;

.

    public const uint VK_OEM_CLEAR = 0xFE;

.

    public static int VK_0 = 0x30;

.

    public static int VK_1 = 0x31;

.

    public static int VK_2 = 0x32;

.

    public static int VK_3 = 0x33;

.

    public static int VK_4 = 0x34;

.

    public static int VK_5 = 0x35;

.

    public static int VK_6 = 0x36;

.

    public static int VK_7 = 0x37;

.

    public static int VK_8 = 0x38;

.

    public static int VK_9 = 0x39;

.

    public static int VK_A = 0x41;

.

    public static int VK_B = 0x42;

.

    public static int VK_C = 0x43;

.

    public static int VK_D = 0x44;

.

    public static int VK_E = 0x45;

.

    public static int VK_F = 0x46;

.

    public static int VK_G = 0x47;

.

    public static int VK_H = 0x48;

.

    public static int VK_I = 0x49;

.

    public static int VK_J = 0x4A;

.

    public static int VK_K = 0x4B;

.

    public static int VK_L = 0x4C;

.

    public static int VK_M = 0x4D;

.

    public static int VK_N = 0x4E;

.

    public static int VK_O = 0x4F;

.

    public static int VK_P = 0x50;

.

    public static int VK_Q = 0x51;

.

    public static int VK_R = 0x52;

.

    public static int VK_S = 0x53;

.

    public static int VK_T = 0x54;

.

    public static int VK_U = 0x55;

.

    public static int VK_V = 0x56;

.

    public static int VK_W = 0x57;

.

    public static int VK_X = 0x58;

.

    public static int VK_Y = 0x59;

.

    public static int VK_Z = 0x5A;

.
Summary
.

static extern short VkKeyScanEx(char ch, IntPtr dwhkl);

.

Private Shared Function VkKeyScanEx(ch As Char, dwhkl As IntPtr) As Short

.

    static extern short VkKeyScanEx(char ch, IntPtr dwhkl);

.

        short keyNumber = VkKeyScanEx(character, pointer);

.
Documentation
[VkKeyScanEx] on MSDN
.
Summary
.

static extern short VkKeyScanEx(char ch, IntPtr dwhkl);

.

Private Shared Function VkKeyScanEx(ch As Char, dwhkl As IntPtr) As Short

.

    static extern short VkKeyScanEx(char ch, IntPtr dwhkl);

.

        short keyNumber = VkKeyScanEx(character, pointer);

.
Documentation
[VkKeyScanEx] on MSDN

Constants

16: WM
.
WM_VKEYTOITEM 0x2E Sent by a list box with the LBS_WANTKEYBOARDINPUT style to its owner in response to a WM_KEYDOWN message.
.

private const UInt32 WM_VKEYTOITEM         = 0x002E;

.

   WM_VKEYTOITEM = &H2E

.

WM_VKEYTOITEM         equ 02Eh

coredll

.

public static extern short GetKeyState(VK nVirtKey);

.

Declare Function GetKeyState Lib "coredll.dll" (ByVal nVirtKey As [VK]) As Short

.

VK

.

   Const VK_NUMLOCK As Integer = CInt(System.Windows.Forms.Keys.NumLock)

.

   Dim keystate As Short = GetKeyState(VK_NUMLOCK)

.

internal static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);

.

Declare Sub keybd_event Lib "coredll.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)

.

        byte bVk,

.

internal static extern bool PostKeybdMessage(IntPtr hwnd, uint vKey, KeyStateFlags flags, uint cCharacters, KeyStateFlags[] pShiftStateBuffer, uint[] pCharacterBuffer);

.

            public ushort wVk;

.

        public const ushort VK_TAB = 0x0009;

.

        public const ushort VK_SHIFT = 0x0010;

.

        public const ushort VK_CTRL = 0x0011;

.

        inputs[0].wVk = inputs[1].wVk = cTabControl.VK_TAB;

.

        inputs[0].wVk = inputs[3].wVk = cTabControl.VK_SHIFT;

.

        inputs[1].wVk = inputs[2].wVk = cTabControl.VK_TAB;

.

        inputs[0].wVk = inputs[3].wVk = cTabControl.VK_CTRL;

.

        inputs[1].wVk = inputs[2].wVk = cTabControl.VK_TAB;

.

        inputs[0].wVk = inputs[5].wVk = cTabControl.VK_CTRL;

.

        inputs[1].wVk = inputs[4].wVk = cTabControl.VK_SHIFT;

.

        inputs[2].wVk = inputs[3].wVk = cTabControl.VK_TAB;

.

    User32.SendMessage(listView1.Handle, User32.WM.WM_KEYDOWN, (int)User32.VK.VK_DOWN, 0);

.

    User32.SendMessage(listView1.Handle, User32.WM.WM_KEYUP, (int)User32.VK.VK_DOWN, 0);

.

    User32.SendMessage(listView1.Handle, User32.WM.WM_KEYDOWN, (int)User32.VK.VK_UP, 0);

.

    User32.SendMessage(listView1.Handle, User32.WM.WM_KEYUP, (int)User32.VK.VK_UP, 0);

.

    public enum VK : int

.

    VK_DOWN = 0x28,

.

    VK_UP = 0x26,

.

    VK_LEFT = 0x25,

.

    VK_RIGHT = 0x27

.

    User32.SendMessage(listView1.Handle, User32.WM.WM_KEYDOWN, (int)User32.VK.VK_UP, 0);

.

    User32.SendMessage(listView1.Handle, User32.WM.WM_KEYUP, (int)User32.VK.VK_UP, 0);

.

    public enum VK : int

.

    VK_DOWN = 0x28,

.

    VK_UP = 0x26,

.

    VK_LEFT = 0x25,

.

    VK_RIGHT = 0x27

Structures

.

        /// Virtual keycode used to terminate streaming capture. The default value is VK_ESCAPE.

.

        public System.UInt32 vKeyAbort; // check this

.

        ''' Virtual keycode used to terminate streaming capture. The default value is VK_ESCAPE.

.

        Public vKeyAbort As Integer

.

    public uint vkCode;

.

    Debug.WriteLine(kbd.vkCode);  // ***** your code here *****

.

        Public vkCode As UInt32

.

    public vkCode As UInt32

.

        internal VirtualKeyShort wVk;

.

  Public wVk As Short

.

        ///The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information,

Enums

.

        TerminalServerVKPACKET = 0x20

.

    TerminalServerVKPACKET = &H20

.
Summary
An enumeration which maps to the various VK_* constants.
.

    VK_LBUTTON = &H1        ' // [LButton] = 001

.

    VK_RBUTTON = &H2        ' // [RButton] = 002

.

    VK_CANCEL = &H3         ' // [Cancel] = 003

.

    VK_MBUTTON = &H4        ' // [MButton] = 004    ' NOT contiguous with L & RBUTTON

.

    VK_XBUTTON1 = &H5       ' // [XButton1] = 005   ' NOT contiguous with L & RBUTTON

.

    VK_XBUTTON2 = &H6       ' // [XButton2] = 006   ' NOT contiguous with L & RBUTTON

.

    VK_BACK = &H8           ' // [Back] = 008

.

    VK_TAB = &H9        ' // [Tab] = 009

.

    VK_CLEAR = &HC          ' // [Clear] = 012

.

    VK_RETURN = &HD         ' // [Return] = 013

.

    VK_SHIFT = &H10         ' // [ShiftKey] = 016

.

    VK_CONTROL = &H11       ' // [ControlKey] = 017

.

    VK_MENU = &H12          ' // [Menu] = 018

.

    VK_PAUSE = &H13         ' // [Pause] = 019

.

    VK_CAPITAL = &H14       ' // [Capital] = 020

.

    VK_HANGUL = &H15        ' // [HangulMode] = 021

.

    VK_HANGEUL = &H15       ' // [HanguelMode] = 021 ' old name (compatibility)

.

    VK_KANA = &H15          ' // [KanaMode] = 021

.

    VK_JUNJA = &H17         ' // [JunjaMode] = 023

.

    VK_FINAL = &H18         ' // [FinalMode] = 024

.

    VK_KANJI = &H19         ' // [KanjiMode] = 025

.

    VK_HANJA = &H19         ' // [HanjaMode] = 025

.

    VK_ESCAPE = &H1B        ' // [Escape] = 027

.

    VK_CONVERT = &H1C       ' // [IMEConvert] = 028

.

    VK_NONCONVERT = &H1D    ' // [IMENonconvert] = 029

.

    VK_ACCEPT = &H1E        ' // [IMEAccept] = 030

.

    VK_MODECHANGE = &H1F    ' // [IMEModeChange] = 031

.

    VK_SPACE = &H20         ' // [Space] = 032

.

    VK_PRIOR = &H21         ' // [Prior] = 033

.

    VK_NEXT = &H22          ' // [Next] = 034

.

    VK_END = &H23           ' // [End] = 035

.

    VK_HOME = &H24          ' // [Home] = 036

.

    VK_LEFT = &H25          ' // [Left] = 037

.

    VK_UP = &H26        ' // [Up] = 038

.

    VK_RIGHT = &H27         ' // [Right] = 039

.

    VK_DOWN = &H28          ' // [Down] = 040

.

    VK_SELECT = &H29        ' // [Select] = 041

.

    VK_PRINT = &H2A         ' // [Print] = 042

.

    VK_EXECUTE = &H2B       ' // [Execute] = 043

.

    VK_SNAPSHOT = &H2C      ' // [Snapshot] = 044

.

    VK_INSERT = &H2D        ' // [Insert] = 045

.

    VK_DELETE = &H2E        ' // [Delete] = 046

.

    VK_HELP = &H2F          ' // [Help] = 047

.

    VK_0 = &H30         ' // [D0] = 048

.

    VK_1 = &H31         ' // [D1] = 049

.

    VK_2 = &H32         ' // [D2] = 050

.

    VK_3 = &H33         ' // [D3] = 051

.

    VK_4 = &H34         ' // [D4] = 052

.

    VK_5 = &H35         ' // [D5] = 053

.

    VK_6 = &H36         ' // [D6] = 054

.

    VK_7 = &H37         ' // [D7] = 055

.

    VK_8 = &H38         ' // [D8] = 056

.

    VK_9 = &H39         ' // [D9] = 057

.

    VK_A = &H41         ' // [A] = 065

.

    VK_B = &H42         ' // [B] = 066

.

    VK_C = &H43         ' // [C] = 067

.

    VK_D = &H44         ' // [D] = 068

.

    VK_E = &H45         ' // [E] = 069

.

    VK_F = &H46         ' // [F] = 070

.

    VK_G = &H47         ' // [G] = 071

.

    VK_H = &H48         ' // [H] = 072

.

    VK_I = &H49         ' // [I] = 073

.

    VK_J = &H4A         ' // [J] = 074

.

    VK_K = &H4B         ' // [K] = 075

.

    VK_L = &H4C         ' // [L] = 076

.

    VK_M = &H4D         ' // [M] = 077

.

    VK_N = &H4E         ' // [N] = 078

.

    VK_O = &H4F         ' // [O] = 079

.

    VK_P = &H50         ' // [P] = 080

.

    VK_Q = &H51         ' // [Q] = 081

.

    VK_R = &H52         ' // [R] = 082

.

    VK_S = &H53         ' // [S] = 083

.

    VK_T = &H54         ' // [T] = 084

.

    VK_U = &H55         ' // [U] = 085

.

    VK_V = &H56         ' // [V] = 086

.

    VK_W = &H57         ' // [W] = 087

.

    VK_X = &H58         ' // [X] = 088

.

    VK_Y = &H59         ' // [Y] = 089

.

    VK_Z = &H5A         ' // [Z] = 090

.

    VK_LWIN = &H5B          ' // [LWin] = 091

.

    VK_RWIN = &H5C          ' // [RWin] = 092

.

    VK_APPS = &H5D          ' // [Apps] = 093

.

    VK_SLEEP = &H5F         ' // [Sleep] = 095

.

    VK_NUMPAD0 = &H60       ' // [NumPad0] = 096

.

    VK_NUMPAD1 = &H61       ' // [NumPad1] = 097

.

    VK_NUMPAD2 = &H62       ' // [NumPad2] = 098

.

    VK_NUMPAD3 = &H63       ' // [NumPad3] = 099

.

    VK_NUMPAD4 = &H64       ' // [NumPad4] = 100

.

    VK_NUMPAD5 = &H65       ' // [NumPad5] = 101

.

    VK_NUMPAD6 = &H66       ' // [NumPad6] = 102

.

    VK_NUMPAD7 = &H67       ' // [NumPad7] = 103

.

    VK_NUMPAD8 = &H68       ' // [NumPad8] = 104

.

    VK_NUMPAD9 = &H69       ' // [NumPad9] = 105

.

    VK_MULTIPLY = &H6A      ' // [Multiply] = 106

.

    VK_ADD = &H6B           ' // [Add] = 107

.

    VK_SEPARATOR = &H6C     ' // [Separator] = 108

.

    VK_SUBTRACT = &H6D      ' // [Subtract] = 109

.

    VK_DECIMAL = &H6E       ' // [Decimal] = 110

.

    VK_DIVIDE = &H6F        ' // [Divide] = 111

.

    VK_F1 = &H70        ' // [F1] = 112

.

    VK_F2 = &H71        ' // [F2] = 113

.

    VK_F3 = &H72        ' // [F3] = 114

.

    VK_F4 = &H73        ' // [F4] = 115

.

    VK_F5 = &H74        ' // [F5] = 116

.

    VK_F6 = &H75        ' // [F6] = 117

.

    VK_F7 = &H76        ' // [F7] = 118

.

    VK_F8 = &H77        ' // [F8] = 119

.

    VK_F9 = &H78        ' // [F9] = 120

.

    VK_F10 = &H79           ' // [F10] = 121

.

    VK_F11 = &H7A           ' // [F11] = 122

.

    VK_F12 = &H7B           ' // [F12] = 123

.

    VK_F13 = &H7C           ' // [F13] = 124

.

    VK_F14 = &H7D           ' // [F14] = 125

.

    VK_F15 = &H7E           ' // [F15] = 126

.

    VK_F16 = &H7F           ' // [F16] = 127

.

    VK_F17 = &H80           ' // [F17] = 128

.

    VK_F18 = &H81           ' // [F18] = 129

.

    VK_F19 = &H82           ' // [F19] = 130

.

    VK_F20 = &H83           ' // [F20] = 131

.

    VK_F21 = &H84           ' // [F21] = 132

.

    VK_F22 = &H85           ' // [F22] = 133

.

    VK_F23 = &H86           ' // [F23] = 134

.

    VK_F24 = &H87           ' // [F24] = 135

.

    VK_NUMLOCK = &H90       ' // [NumLock] = 144

.

    VK_SCROLL = &H91        ' // [Scroll] = 145

.

    VK_OEM_NEC_EQUAL = &H92     ' // [NEC_Equal] = 146    ' NEC PC-9800 kbd definitions "=" key on numpad

.

    VK_OEM_FJ_JISHO = &H92      ' // [Fujitsu_Masshou] = 146    ' Fujitsu/OASYS kbd definitions "Dictionary" key

.

    VK_OEM_FJ_MASSHOU = &H93    ' // [Fujitsu_Masshou] = 147    ' Fujitsu/OASYS kbd definitions "Unregister word" key

.

    VK_OEM_FJ_TOUROKU = &H94    ' // [Fujitsu_Touroku] = 148    ' Fujitsu/OASYS kbd definitions "Register word" key  

.

    VK_OEM_FJ_LOYA = &H95       ' // [Fujitsu_Loya] = 149    ' Fujitsu/OASYS kbd definitions "Left OYAYUBI" key

.

    VK_OEM_FJ_ROYA = &H96       ' // [Fujitsu_Roya] = 150    ' Fujitsu/OASYS kbd definitions "Right OYAYUBI" key

.

    VK_LSHIFT = &HA0        ' // [LShiftKey] = 160

.

    VK_RSHIFT = &HA1        ' // [RShiftKey] = 161

.

    VK_LCONTROL = &HA2      ' // [LControlKey] = 162

.

    VK_RCONTROL = &HA3      ' // [RControlKey] = 163

.

    VK_LMENU = &HA4         ' // [LMenu] = 164

.

    VK_RMENU = &HA5         ' // [RMenu] = 165

.

    VK_BROWSER_BACK = &HA6      ' // [BrowserBack] = 166

.

    VK_BROWSER_FORWARD = &HA7   ' // [BrowserForward] = 167

.

    VK_BROWSER_REFRESH = &HA8   ' // [BrowserRefresh] = 168

.

    VK_BROWSER_STOP = &HA9      ' // [BrowserStop] = 169

.

    VK_BROWSER_SEARCH = &HAA    ' // [BrowserSearch] = 170

.

    VK_BROWSER_FAVORITES = &HAB ' // [BrowserFavorites] = 171

.

    VK_BROWSER_HOME = &HAC      ' // [BrowserHome] = 172

.

    VK_VOLUME_MUTE = &HAD       ' // [VolumeMute] = 173

.

    VK_VOLUME_DOWN = &HAE       ' // [VolumeDown] = 174

.

    VK_VOLUME_UP = &HAF     ' // [VolumeUp] = 175

.

    VK_MEDIA_NEXT_TRACK = &HB0  ' // [MediaNextTrack] = 176

.

    VK_MEDIA_PREV_TRACK = &HB1  ' // [MediaPreviousTrack] = 177

.

    VK_MEDIA_STOP = &HB2    ' // [MediaStop] = 178

.

    VK_MEDIA_PLAY_PAUSE = &HB3  ' // [MediaPlayPause] = 179

.

    VK_LAUNCH_MAIL = &HB4       ' // [LaunchMail] = 180

.

    VK_LAUNCH_MEDIA_SELECT = &HB5 ' // [SelectMedia] = 181

.

    VK_LAUNCH_APP1 = &HB6       ' // [LaunchApplication1] = 182

.

    VK_LAUNCH_APP2 = &HB7       ' // [LaunchApplication2] = 183

.

    VK_OEM_1 = &HBA         ' // [Oem1] = 186           ' ";:" for USA

.

    VK_OEM_PLUS = &HBB      ' // [Oemplus] = 187        ' "+" any country

.

    VK_OEM_COMMA = &HBC     ' // [Oemcomma] = 188       ' "," any country

.

    VK_OEM_MINUS = &HBD     ' // [OemMinus] = 189       ' "-" any country

.

    VK_OEM_PERIOD = &HBE    ' // [OemPeriod] = 190      ' "." any country

.

    VK_OEM_2 = &HBF         ' // [Oem2] = 191           ' "/?" for USA

.

    VK_OEM_3 = &HC0         ' // [Oem3] = 192           ' "'~" for USA

.

    VK_OEM_4 = &HDB         ' // [Oem4] = 219           ' "[{" for USA

.

    VK_OEM_5 = &HDC         ' // [Oem5] = 220           ' "\|" for USA

.

    VK_OEM_6 = &HDD         ' // [Oem6] = 221           ' "]}" for USA

.

    VK_OEM_7 = &HDE         ' // [Oem7] = 222           ' "'"" for USA

.

    VK_OEM_8 = &HDF         ' // [Oem8] = 223

.

    VK_OEM_AX = &HE1        ' // [OEMAX] = 225          ' "AX" key on Japanese AX kbd

.

    VK_OEM_102 = &HE2       ' // [Oem102] = 226         ' "<>" or "\|" on RT 102-key kbd

.

    VK_ICO_HELP = &HE3      ' // [ICOHelp] = 227        ' Help key on ICO

.

    VK_ICO_00 = &HE4        ' // [ICO00] = 228          ' 00 key on ICO

.

    VK_PROCESSKEY = &HE5    ' // [ProcessKey] = 229

.

    VK_ICO_CLEAR = &HE6     ' // [ICOClear] = 230

.

    VK_PACKET = &HE7        ' // [Packet] = 231

.

    VK_OEM_RESET = &HE9     ' // [OEMReset] = 233

.

    VK_OEM_JUMP = &HEA      ' // [OEMJump] = 234

.

    VK_OEM_PA1 = &HEB       ' // [OEMPA1] = 235

.

    VK_OEM_PA2 = &HEC       ' // [OEMPA2] = 236

.

    VK_OEM_PA3 = &HED       ' // [OEMPA3] = 237

.

    VK_OEM_WSCTRL = &HEE    ' // [OEMWSCtrl] = 238

.

    VK_OEM_CUSEL = &HEF     ' // [OEMCUSel] = 239

.

    VK_OEM_ATTN = &HF0      ' // [OEMATTN] = 240

.

    VK_OEM_FINISH = &HF1    ' // [OEMFinish] = 241

.

    VK_OEM_COPY = &HF2      ' // [OEMCopy] = 242

.

    VK_OEM_AUTO = &HF3      ' // [OEMAuto] = 243

.

    VK_OEM_ENLW = &HF4      ' // [OEMENLW] = 244

.

    VK_OEM_BACKTAB = &HF5       ' // [OEMBackTab] = 245

.

    VK_ATTN = &HF6          ' // [Attn] = 246

.

    VK_CRSEL = &HF7         ' // [Crsel] = 247

.

    VK_EXSEL = &HF8         ' // [Exsel] = 248

.

    VK_EREOF = &HF9         ' // [EraseEof] = 249

.

    VK_PLAY = &HFA          ' // [Play] = 250

.

    VK_ZOOM = &HFB          ' // [Zoom] = 251

.

    VK_NONAME = &HFC        ' // [NoName] = 252

.

    VK_PA1 = &HFD           ' // [Pa1] = 253

.

    VK_OEM_CLEAR = &HFE     ' // [OemClear] = 254

27: VK
.

       enum VK : int

.

        ///Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT, SendInput, WM_KEYDOWN, and WM_KEYUP

.

Enum VK

.
Documentation
[VK] on MSDN
.

    VKEYTOITEM = 0x002E,

.

    WM_VKEYTOITEM = &H2E


 
Access PInvoke.net directly from VS: