vb.net制作数值键盘 vbs 键盘输入( 三 )


Private Const VK_F20 = H83
Private Const VK_F21 = H84
Private Const VK_F22 = H85
Private Const VK_F23 = H86
Private Const VK_F24 = H87
Private Const VK_NUMLOCK = H90
Private Const VK_SCROLL = H91
'
'VK_L*VK_R* - left and right Alt, Ctrl and Shift virtual keys.
'Used only as parameters to GetAsyncKeyState() and GetKeyState().
'No other API or message will distinguish left and right keys in this way.
'
Private Const VK_LSHIFT = HA0
Private Const VK_RSHIFT = HA1
Private Const VK_LCONTROL = HA2
Private Const VK_RCONTROL = HA3
Private Const VK_LMENU = HA4
Private Const VK_RMENU = HA5
'dwFlags
Private Const KEYEVENTF_EXTENDEDKEY = H1
Private Const KEYEVENTF_KEYUP = H2
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Sub Command1_Click()
Call keybd_event(VK_MENU, 0, KEYEVENTF_EXTENDEDKEY, 0) '按下Alt键
Call keybd_event(VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY, 0) '按下Print Screen键
Call keybd_event(VK_SNAPSHOT, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0) '抬起Print Screen键
Call keybd_event(VK_MENU, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0) '抬起Alt键
Call keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY, 0) '按下Win键
Call keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0) '抬起Win键
Call keybd_event(VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY, 0) '按下Num Lock键
Call keybd_event(VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0) '抬起Num Lock键
End Sub
vb.net制作数值键盘的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于vbs 键盘输入、vb.net制作数值键盘的信息别忘了在本站进行查找喔 。

推荐阅读