如何虚拟激活“MadCatz Strike 7”键盘的特殊功能键?发送它的键码应该让 MadCatz7 软件像注册一个物理按键一样。
是否有这些功能键的键码(或者有更好的方法)?我正在编写一个 AutoIt 脚本,它应该让 MadCatz 软件通过激活相应的特殊功能键来完成剩下的工作。
最佳答案
试着用这段代码找出 key 。通常,您的特殊功能键有一个替代热键,如 ctrl+alt+F10 或其他。
Opt('GUICloseOnESC', 0)
Global $tState = DllStructCreate('byte[256]')
GUICreate('MyGUI', 200, 200)
$Label = GUICtrlCreateLabel('', 20, 72, 160, 52, 0x01)
GUICtrlSetFont(-1, 32, 800, 0, 'Tahoma')
GUISetState()
$Prev = -1
While 1
Sleep(10)
If GUIGetMsg() = -3 Then
ExitLoop
EndIf
$Key = 0
$Ret = DllCall('user32.dll', 'int', 'GetKeyboardState', 'ptr', DllStructGetPtr($tState))
For $i = 0x08 To 0xFF
Switch $i
Case 0x0A, 0x0B, 0x0E To 0x0F, 0x16, 0x1A, 0x1C To 0x1F, 0x3A To 0x40, 0x5E, 0x88 To 0x8F, 0x97 To 0x9F, 0xB8 To 0xB9, 0xC1 To 0xDA, 0xE0, 0xE8
ContinueLoop
Case Else
If BitAND(DllStructGetData($tState, 1, $i + 1), 0xF0) Then
$Key = $i
ExitLoop
EndIf
EndSwitch
Next
If $Key <> $Prev Then
GUICtrlSetData($Label, '0x' & Hex($Key, 2))
$Prev = $Key
EndIf
WEnd
关于keyboard - 虚拟按键到游戏键盘的功能键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45490024/