2013-06-01 205 views
1

我想改變使用Ctrl鍵以空格鍵爲遊戲中的三個命令而不是一切都引起那麼我不能使用空間連通。正常的命令是Ctrl + q,Ctrl + w,Ctrl + e,Ctrl + r和Control + RButton(鼠標右鍵)。現在我是空間:: Ctrl,但我已經嘗試了不同的解決方案,但沒有結果。AutoHotkey的組合鍵(重映射)關鍵修飾符

[EDIT /]
@MCL確定。我查看了你發佈的論壇主題,並嘗試了sorta工作的代碼。它發送了我想要的密鑰,但每個快捷方式都觸發了它後面的所有快捷方式。例如,space + e觸發space + e,space + r和space。

另外,空格鍵仍然沒有奏效。我稍後添加了Space :: Space,並且只能通過使用Space +(q,w,e或r)快捷鍵來獲得文本空間。

SendMode Input 
SetKeyDelay ,0,30 

#IfWinActive ahk_class RiotWindowClass 

Space & q:: 
      Send {Ctrl down} 
      Sleep 30 
      Send {q down} 
      Sleep 30 
      Send {q up} 
      Sleep 30 
      Send {Ctrl up} 

Space & w:: 
      Send {Ctrl down} 
      Sleep 30 
      Send {w down} 
      Sleep 30 
      Send {w up} 
      Sleep 30 
      Send {Ctrl up} 

Space & e:: 
      Send {Ctrl down} 
      Sleep 30 
      Send {e down} 
      Sleep 30 
      Send {e up} 
      Sleep 30 
      Send {Ctrl up} 

Space & r:: 
      Send {Ctrl down} 
      Sleep 30 
      Send {r down} 
      Sleep 30 
      Send {r up} 
      Sleep 30 
      Send {Ctrl up} 

Space & RButton:: 
      Send {Ctrl down} 
      Sleep 30 
      Send {RButton down} 
      Sleep 30 
      Send {RButton up} 
      Sleep 30 
      Send {Ctrl up} 

Space::Space 

#IfWinActive 

[/編輯]

+0

您肯定,AHK發送您的密鑰嗎?否則,遊戲可能是你的問題,阻止模擬擊鍵(可能有選擇性)。另外,爲了保持空間的原始功能,只需在代碼中添加「SPACE :: Send,{空格}」。有條不紊地發現問題:1. AHK註冊您的按鍵嗎? 2. AHK一般會發送你的捷徑嗎? (首先在遊戲外嘗試!)3.您的窗口是否接收到AHK模擬擊鍵? – MCL

+0

感謝MCL爲您的時間。 ||我剛剛測試了以下內容:Space&q ::發送文本 - 它將它發送到Notepad ++ || Space&q :: Send!q - 我將Ctrl + q設置爲Launchy的快捷方式,併成功打開它。所以看起來Send命令在遊戲中不起作用。但是,Space :: Ctrl的作品。我使用該重映射命中Space + q,遊戲將其檢測爲Ctrl + q。 –

+0

只是一種預感,但嘗試玩弄以下指令:'#InstallKeybdHook'和'#在不同的組合UseHook'(只是把它們在你的腳本的頂部)。另外,找出AHK是否註冊你的按鍵(最好通過寫入文件)。 – MCL

回答

0

找到它。我需要添加回報。

#NoEnv 
SendMode Input 
#InstallKeybdHook 
#UseHook 

#IfWinActive ahk_class RiotWindowClass 

Space & q:: 
      Send {Ctrl down} 
      Sleep 30 
      Send {q down} 
      Sleep 30 
      Send {q up} 
      Sleep 30 
      Send {Ctrl up} 
      return 

Space & w:: 
      Send {Ctrl down} 
      Sleep 30 
      Send {w down} 
      Sleep 30 
      Send {w up} 
      Sleep 30 
      Send {Ctrl up} 
      return 

Space & e:: 
      Send {Ctrl down} 
      Sleep 30 
      Send {e down} 
      Sleep 30 
      Send {e up} 
      Sleep 30 
      Send {Ctrl up} 
      return 

Space & r:: 
      Send {Ctrl down} 
      Sleep 30 
      Send {r down} 
      Sleep 30 
      Send {r up} 
      Sleep 30 
      Send {Ctrl up} 
      return 

Space & RButton:: 
      Send {Ctrl down} 
      Sleep 30 
      Send {RButton down} 
      Sleep 30 
      Send {RButton up} 
      Sleep 30 
      Send {Ctrl up} 
      return 

Space:: 
      Send {Space} 
      return 

#IfWinActive 
+0

好的......只是注意到有一件事情仍然無效。空間只能作爲文字使用,並不能作爲將角色置於鏡頭中心的捷徑。 GRRRR –

+0

首先,請不要將回答或問題提交給特定用戶。 SO上的每個人都可能對您的主題有所貢獻。其次取而代之的是睡覺的,我會用SetKeyDelay,它一方面可以使代碼更短,更易讀,而在另一方面,可以讓你修改PressDuration了。也許,玩SetKeyDelay可以解決你的空間問題。 – MCL

+0

我試過SetKeyDelay,它不起作用。無論是^ q還是{Control down} q {Control up}或Space camera功能。 –