當前位置:編程學習大全網 - 網站源碼 - 如何用按鍵精靈讓鍵盤模擬鼠標

如何用按鍵精靈讓鍵盤模擬鼠標

難得在知道上看到這麽有意思的題目,下面是我的代碼:

Declare?Function?GetAsyncKeyState?Lib?"user32"?Alias?"GetAsyncKeyState"?(ByVal?vKey?As?Long)?As?Integer

nowleft?=?0

While?1

If?GetAsyncKeyState(88)?<?0?and?nowleft=0?Then?

LeftDown?1

nowleft?=?1

ElseIf?GetAsyncKeyState(88)?>=0?and?nowleft=1?then

LeftUp?1

nowleft=0

End?If

Delay?50

Wend

裏面用到了windows提供的api:GetAsyncKeyState,檢測X鍵的狀態。

這段代碼完美的滿足了妳的要求,希望對妳有幫助!^o^

  • 上一篇:主源代碼索引
  • 下一篇:今年有什麽好看的電視劇嗎?
  • copyright 2024編程學習大全網