我想要一个简单的程序来在我按下一个键时冻结/解冻输入

问题描述

这看起来很简单,但我在任何地方都找不到。我想要一个简单的程序(比如 AutoHotkey,但我找不到用 AutoHotkey 来做到这一点的方法)它会冻结我的键盘和鼠标(无论我当时按下什么,都会被按下,即使我释放了实际的键/button) 当我按下某个键时,并保持它冻结直到我再次按下该键(所选的键永远不会被其他程序认为按下)。

我只是想要这样,如果游戏希望我按住某些按钮,我可以按下按钮,按下指定的键,然后松开,然后在我应该释放按钮时再次按下该键。

解决方法

这适用于文本编辑器。不过不确定它在游戏中的运作方式。

module.exports = env => {


switch(env) {
    case 'development':
      return merge(commonConfig,developmentConfig);
    case 'production':
      return merge(commonConfig,productionConfig);
    default:
      throw new Error('No matching configuration was found!');
  }
}

更新:同样,您必须在游戏中对此进行测试。

#NoEnv
#Warn
#SingleInstance Force
#UseHook
SetWorkingDir %A_ScriptDir%
SendMode Input

Global isHold := false ; Alternates between "true" and "false" at each "LShift" press.

; Hotkey below will only be active if the game's window is active
#IfWinActive "PutYourGameWindowTitleHere"

; Sends {LShift Down} if isHold == false,{LShift Up} if isHold == true
; Asterisk means it will work even if other keys are held at the same time.
*LShift::Send % (isHold := !isHold) ? "{LShift Down}" : "{LShift Up}"

#IfWinActive