AutoHotKey

Autohotkey - multiple scripts and different language issues

牧云@^-^@ 提交于 2019-12-12 00:43:44
问题 I use autohotkey to simplify copying, using Alt+W instead of Ctrl + C . However, I often switch my keyboard to a Hebrew layout, so the w key is now the ' key. Then the autohotkey script for w doesn't work. I tried to write a second script into the same file but it doesn't get activated when I press Alt + ' when I'm in the Hebrew layout. I'm not sure whether it's my syntax or something else, any ideas? This is my code: !w:: Send, {ctrl down}{a down}{a up}{c down}{c up}{ctrl up} return !'::

String to Number using autohotkey

左心房为你撑大大i 提交于 2019-12-11 22:56:29
问题 I would like to get my tail function to grab the last line in logfile and turn it into a number. So that I can then use it in a if condition. file = C:\Users\%A_UserName%\Documents\logTime.txt Tail(k,file) ; Return the last k lines of file { Loop Read, %file% { i := Mod(A_Index,k) L%i% = %A_LoopReadLine% } L := L%i% Loop % k-1 { IfLess i,1, SetEnv i,%k% i-- ; Mod does not work here L := L%i% "`n" L } ;Return L ;msgbox % Tail(1,file) } The if condition While (PrLoad > 5 ) ; Assign the Number

Autohotkey. Hold two buttons and tap another to increase volume

此生再无相见时 提交于 2019-12-11 22:41:29
问题 I got stuck building an ahk shortcut script to increase / decrease Volume. The idea was to hold down LAlt+LShift and tap F12 to increase one step per tap. The order in which LAlt and LShift are pressed shouldn't matter. I came up with this so far: !+:: While (GetKeyState("LShift","P")) and (GetKeyState("LAlt","P")) { F12::Send {Volume_Up} } Return But somehow it increases the volume on holding LAlt and taping F12. LShift gets igronred.. What's wrong with that... 回答1: This F12::Send {Volume_Up

How to set `underline` followed by a character to send another key

夙愿已清 提交于 2019-12-11 21:16:11
问题 When I use the following , autohotkey says 'Error:Invalid hotkey". Is there any way to fix it? _t::T 回答1: AutoHotkey has Hotstrings and Hotkeys . Hotstrings What you have there is a "Hotkey" (e.g. a key on keyboard). As there is no such key it is indeed an error. So what do you want, do you want to type _t followed by a space, tab or other Endcharacter and have it replaced by T? In that case it is ::_t::T so you need to start the line with a : More about Hotstrings and various options here

autohotkey loop through txt and send each line

♀尐吖头ヾ 提交于 2019-12-11 19:47:01
问题 I am attempting to loop through the list in VarX and send the keystrokes requested until the list is done. Right now it seems to jumble up and not run the commands correctly in order. any ideas of what I have wrong? it should run like this: ctrl f 48306237 enter tab tab tab tab enter shift space ctrl - then repeat with the next number... ^!G:: VarX= ( 48306237 48306642 48303423 48303612 48303797 ) loop, parse, VarX, `n,`r { Send, ^f Send, %VarX% Send, {enter} Send, {tab}{tab}{tab}{tab}{enter}

remapping right click and drag as xbutton1 click and drag

强颜欢笑 提交于 2019-12-11 19:12:20
问题 I want to remap right click and drag as XButton1 click and drag. This is what I tried: RButtonclickdrag::XButton1clickdrag I think I don't have the correct commands but I have searched a lot and not found anything else. Could somebody please give me some help? Thanks, Ellen 回答1: Here is a way to do this. Let me know if this suits your needs. The time is set to 100 ms. #SingleInstance Force #installKeybdHook #Persistent #ifWinActive ahk_class CorelDRAW 15.2 $RButton:: Sleep, 100 GetKeyState,

Sending Combo Key action simulating DirectInput

£可爱£侵袭症+ 提交于 2019-12-11 19:11:45
问题 I found this useful script on this thread to remap a key on a game. T:: SetKeyDelay,300 Send {Blind}{b DownTemp} Send {Blind}{b Up} It works for the game I'm playing but I have not figured it out for a more sophisticated command like remapping T to Ctrl + B ? I thought of changing the script like this, but it doesn't work: T:: SetKeyDelay,300 Send {Blind}{Ctrl DownTemp} Send {Blind}{b DownTemp} Send {Blind}{b Up} Send {Blind}{Ctrl Up} return 来源: https://stackoverflow.com/questions/21557385

lua macros for second keyboard

孤者浪人 提交于 2019-12-11 17:36:05
问题 I am trying to use a second keyboard as a Macro Board, I am using the program Lua Macros and an AutoHotkey script. I was wondering if anyone knew how to print text through this. For example when I press the 'o' key on my second keyboard 'Hello World' would be written instead if I were working in google chrome or other programs. 回答1: If you want to use 2 different keyboards, then you could try to use HIDMacros. This program can still work together with AHK and it allows you to define hotkeys

AutoHotKey Error “variable name contains an illegal character ”100.000000"

不问归期 提交于 2019-12-11 17:14:41
问题 I am making an AutoHotKey script so that I have media keys on my media key-less keyboard. All of the shortcuts are working but i want to make one that will set the volume to max, unless it is already, in which case it would set it to 10. Here is my script as it is: SoundGet, master_volume ^!Down::SendInput {Media_Play_Pause} ^!Left::SendInput {Media_Prev} ^!Right::SendInput {Media_Next} ^!Up::SendInput {Media_Stop} ^!+Down::SendInput {Volume_Mute} ^!+Left::SendInput {Volume_Down} ^!+Right:

How to toggle an AHK script on/off with a key?

本秂侑毒 提交于 2019-12-11 17:00:43
问题 I'm working on a Script that constrains the movement of the cursor to the horizontal direction only. I would like to activate and deactivate it using the same hotkey. I'm using this code: #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. !s:: ; Hotkey will toggle status Confine := !Confine