I have the following script for a couple of VK keys for keyboard event but need the following keys also, can someone please help.
The keys I need are
CTRL 1 (together) i.e. SendKeys ("^{1}")
F3
Enter
script to type something like "Hello there"
Escape
If anyone could help I would appreciate it.
Code:
Private Declare Sub keybd_event Lib "user32" ( _
ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)
Private Const VK_NUMLOCK = &H90
Private Const VK_TAB = 9
Private Const VK_ENTER = 13
Private Const VK_DOWN = 31
Private Const VK_UP = 30
Private Const VK_a = 65
Private Const vk_lcontrol = 2
Private Const vk_t = 3
Private Const KEYEVENTF_KEYUP = &H2
Declare Function GetKeyState Lib "user32.dll" ( _
ByVal nVirtKey As Long) As Integer
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" ( _
Destination As Any, _
Source As Any, _
ByVal Length As Long)
Code:
Sub test()
ActivateWindow "Firefox"
If (GetKeyState(vbKeyTab) = 1) Then
keybd_event VK_TAB, 1, 0, 0
keybd_event VK_TAB, 1, KEYEVENTF_KEYUP, 0
keybd_event VK_TAB, 1, 0, 0
keybd_event VK_TAB, 1, KEYEVENTF_KEYUP, 0
End If
End Sub
The keys I need are
CTRL 1 (together) i.e. SendKeys ("^{1}")
F3
Enter
script to type something like "Hello there"
Escape
If anyone could help I would appreciate it.