【问题标题】:AutoHotkey - Ignore the pressed keyAutoHotkey - 忽略按下的键
【发布时间】:2013-11-21 09:49:42
【问题描述】:

我希望我的自动热键脚本在我按下键盘上的 shift+3 键后点击鼠标,忽略按住的 shift 键。

例如我已经尝试过这种方式:

   +3::
SetMouseDelay, 0
MouseGetPos, xpos, ypos
Send {Shift Up}
BlockInput, on
Send {Shift Up}
MouseClick, right, uhxpos, uhypos
Sleep, 41
MouseClick, left, yourxpos, yourypos
MouseMove, xpos, ypos
BlockInput, off
return

甚至试图等到换班物理释放后,仍然没有成功;

+3::
SetMouseDelay, 0
MouseGetPos, xpos, ypos
KeyWait, +  
MouseClick, right, uhxpos, uhypos
Sleep, 41
MouseClick, left, yourxpos, yourypos
MouseMove, xpos, ypos
return

不胜感激,谢谢。

【问题讨论】:

  • 那么,你正在按住 shift 你推shiftf3?还是您希望例程在之后在您推送shiftf3 之后运行,但尽管有可能按住 shift 键?
  • 也许你用错了方法。你到底想通过阻止shift来完成什么?

标签: autohotkey


【解决方案1】:

尝试在 {Shift Up} 之前发送 {Shift Down},也许您应该将 Send 替换为 SendInput:

+3::
  MouseGetPos, xpos, ypos
  SetMouseDelay, 0
  Sleep, 100
  SendInput, {Shift Down}
  SendInput, {Shift Up}
  MouseClick, right, uhxpos, uhypos
  Sleep, 41
  MouseClick, left, yourxpos, yourypos
  MouseMove, xpos, ypos
Return

【讨论】:

    【解决方案2】:

    使用KeyWait, Shift 代替KeyWait, +

    【讨论】:

      猜你喜欢
      • 2022-08-04
      • 1970-01-01
      • 1970-01-01
      • 2013-05-26
      • 2013-03-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多