AutoHotKey

Autohotkey application-specific hotkeys

妖精的绣舞 提交于 2019-12-01 04:58:55
I am a newbie to Autohotkey, and I can't figure this out despite reading through this site and the official documentation. I just want to have certain hotkeys work only with certain applications. So for example, if I press spacebar in a certain game I want it to send ` (grave), but if I'm not in that game I want spacebar to function normally. Everything I try seems to make spacebar do nothing when I'm not in game. I can try using an "else" statement to send the spacebar, but that just seems to make an infinite loop. Help! EDIT: Thank you NbdNnm. Here's exactly what ended up working for me:

AutoHotKey: Calling one script from another script

别等时光非礼了梦想. 提交于 2019-12-01 03:15:00
I just discovered AutoHotKey and it seems like a dream come true. I have two .ahk scripts, A.ahk and B.ahk . I want to call script B from within script A. The AHK forums are strangely silent on the subject but I am sure this is possible. Corey It's the #Include directive you are looking for. You include ScriptB.ahk, then call its functions like you normally would. #include SomeFile.ahk http://www.autohotkey.com/docs/commands/_Include.htm Using an #include directive is more common, but occasionally you will need to call an external AHK script. This is easily accomplished using the Run or

How to make a batch file to run a hotkey

点点圈 提交于 2019-12-01 02:42:19
问题 Every time I start my Windows I want to execute a hotkey ( Ctrl + Alt + 1 ) using a batch file and putting it in startup folder. Is that even possible? Is there a command for that? 回答1: You can't send keys directly from a batch file, instead you can create a VB script to send the keys and call this script from a .bat file Put the following code to a VB script, for example sendkeys.vbs (^ is Ctrl and % is Alt ) Set WshShell = WScript.CreateObject("WScript.Shell") WshShell.SendKeys "^%1" Put

Autohotkey application-specific hotkeys

别来无恙 提交于 2019-12-01 01:58:43
问题 I am a newbie to Autohotkey, and I can't figure this out despite reading through this site and the official documentation. I just want to have certain hotkeys work only with certain applications. So for example, if I press spacebar in a certain game I want it to send ` (grave), but if I'm not in that game I want spacebar to function normally. Everything I try seems to make spacebar do nothing when I'm not in game. I can try using an "else" statement to send the spacebar, but that just seems

How to activate a function everytime the target window becomes active in AutoHotkey

倾然丶 夕夏残阳落幕 提交于 2019-12-01 00:16:29
I would like to activate a sound profile every time I switch to a specific program and change back to the default profile every time I leave it. This action is turned on in a GUI via a radio button. The workaround I have created is: Auto_Ftsps: gui, Submit, NoHide While (Rad3==1) { Previous_window:= WinActive("A") Sleep,1000 Current_window:= WinActive("A") If (Previous_window =Current_window) {} Else If (Previous_window !=Current_window) { If(WinActive("Fortnite")) Run_Peace_Profile("Ftsps") Else Run_Peace_Profile("Graphic EQ") } Sleep,2000 } return Is there a better way to do this? I looked

Get Selected Text Without Using the Clipboard

蓝咒 提交于 2019-11-30 15:35:50
问题 I am trying to create a pretty basic text wrapper in AutoHotKey for use when programming. I got it to work using the clipboard to copy the selected text, modify it, then paste it, but I am trying to refrain from using the clipboard since it does not work well in conjunction with my Clipboard Manager. Does anyone know how to do this? !r:: ;Alt+R+%Char% = Wrap Text with Input Characters ClipSave := ClipboardAll Send ^c Input, Char, L1 if ("" . Char = "{") { clipboard = {%clipboard%} } else if (

Get Selected Text Without Using the Clipboard

落花浮王杯 提交于 2019-11-30 15:12:00
I am trying to create a pretty basic text wrapper in AutoHotKey for use when programming. I got it to work using the clipboard to copy the selected text, modify it, then paste it, but I am trying to refrain from using the clipboard since it does not work well in conjunction with my Clipboard Manager. Does anyone know how to do this? !r:: ;Alt+R+%Char% = Wrap Text with Input Characters ClipSave := ClipboardAll Send ^c Input, Char, L1 if ("" . Char = "{") { clipboard = {%clipboard%} } else if ("" . Char = "[") { clipboard = [%clipboard%] } else if ("" . Char = "(") { clipboard = (%clipboard%) }

Mapping Caps Lock to Control from within Emacs on Windows

天大地大妈咪最大 提交于 2019-11-30 14:57:07
问题 When reading either of these questions or the EmacsWiki article about mapping Caps Lock to Control in emacs in Windows, the best answers seem to involve the registry. My question is what a user can do when they can't modify the registry of the machine because they don't have admin rights. Is there a way to do the mapping from within emacs? This article comes oh-so-close, even saying, "As people have mentioned, you can of course map Caps-Lock to other keys instead, for example the Control key.

Mapping Caps Lock to Control from within Emacs on Windows

一个人想着一个人 提交于 2019-11-30 12:57:00
When reading either of these questions or the EmacsWiki article about mapping Caps Lock to Control in emacs in Windows, the best answers seem to involve the registry. My question is what a user can do when they can't modify the registry of the machine because they don't have admin rights. Is there a way to do the mapping from within emacs? This article comes oh-so-close, even saying, "As people have mentioned, you can of course map Caps-Lock to other keys instead, for example the Control key." But I can't figure out how to represent the control key (using various references that look pretty

How to activate a function everytime the target window becomes active in AutoHotkey

我只是一个虾纸丫 提交于 2019-11-29 23:11:37
问题 I would like to activate a sound profile every time I switch to a specific program and change back to the default profile every time I leave it. This action is turned on in a GUI via a radio button. The workaround I have created is: Auto_Ftsps: gui, Submit, NoHide While (Rad3==1) { Previous_window:= WinActive("A") Sleep,1000 Current_window:= WinActive("A") If (Previous_window =Current_window) {} Else If (Previous_window !=Current_window) { If(WinActive("Fortnite")) Run_Peace_Profile("Ftsps")