按键精灵吧 关注:499,757贴子:1,016,418
  • 0回复贴,共1

多线程 ♻️【检测】按了 键盘 or 鼠标

只看楼主收藏回复

#多线程#【问题】有时候按(两下)才能检测到,按的第一下不记录。
Dimenv 线程ID1, 线程ID2
线程ID1 = BeginThread(鼠标) '记录 鼠标
线程ID2 = BeginThread(键盘) '记录 键盘
Do
Delay 200
Loop
Function 鼠标()
Do
M=WaitClick() '等待按 任意鼠标
GetCursorPos mx,my '记录 鼠标坐标
If M = 32769 Then
TracePrint "左"&M
TracePrint mx&","&my
ElseIf M = 32773 then
TracePrint "右"&M
TracePrint mx&","&my
End If
delay 100
M=""
Loop
End Function
Function 键盘()
Do
key=WaitKey() '等待按 任意按键
TracePrint key
Delay 100
Key=""
Loop
End Function


IP属地:湖北来自Android客户端1楼2024-09-17 02:24回复