1

我最近弄坏了我的键盘,并在 autohotkey 中编写了一些非常临时的、低效的程序来修复它们

这是我当前笔记本电脑键盘的输出: y = ry h = fh n = {enter}+n 6 = 46

我目前为每个损坏的键运行 4 个自动热键文件。以下是 h 的文件

hadjust.ahk

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

while true {

KeyWait, h,D
Sleep 20
Send {BS}
Send {BS}
Send {h}


}

如何将四个 .ahk 文件合并为 1 个?有没有更好的方法来做到这一点?

** 编辑我找到了一种在一个文件中执行此操作的方法,但我无法使用 n/enter 键。

这是代码...

堆栈调整.ahk

:?*:fh::h
:?*:hf::h
:?*:ry::y
:?*:yr::y
:?*:46::6
:?*:64::6
:?*:n{Enter}::n
:?*:{Enter}n::n
4

2 回答 2

2

对于最后两个条目,您可以使用以下代码:

:*:n`n::n
:*:`nn::n

;Comment: `n = {Enter}
于 2013-06-10T11:25:09.920 回答
1

如果您的键盘大致同时发送双键,则可以将它们设置为双热键。

这样你仍然可以输入像“愤怒”这样的词......

y & r::send, {blind}r
$y::send, {blind}y
$+y::send, {blind}Y
4 & 6::send, {blind}6
$4::send, {blind}4
$+4::send, {blind}$
f & h::send, {blind}h
$f::send, {blind}f
$+f::send, {blind}F
n & Enter::send, {blind}n
$n::send, {blind}n
$+n::send, {blind}N
$Enter::
if (A_PriorHotkey = "n") and (A_TimeSincePriorHotkey < 500)
{
  Soundbeep, 500, 200
  return
}
Send, {Enter}
return

发送“blind”(针对 shift、alt 和 ctrl 状态)可能没有必要,但不会造成伤害。更新:由于 Enter 似乎更卡住,我将在最后一个 n 后最多 500 毫秒内删除 Enter。在这种情况下,我会发出提示音。

于 2013-06-10T13:23:18.797 回答