AutohotKey assign symbols - autohotkey

I want to get <- when I press alt+s
I use this code below but it does not work. I believe, you cannot put 2 symbols into brackets. How to assign it correctly??
!s::SendInput {<}

!s::SendRaw <- or !s::SendInput {<}-

Related

How to combine keys in hotkeys in autohotkeys?

I want to set up a hotkey by pressing Alt, q and the Left arrow. So far I've tried
# opt 1
!q & Left::
#opt 2
Alt & q & Left::
# opt 3
!qLeft:: M
but the only result I get once I run the script is Error: invalid hotkey in the line above. There seems something is wrong with the ampersand.
I can share the whole script if needed.
According to the Custom Combinations section of the documentation:
Combinations of three or more keys are not supported.
However, I found this class that claims to
enable easy usage of custom multi-key hotkeys.
I haven't tested it myself, but if that hotkey is important to you, then it might be worth trying!
Here's a slightly janky solution using vanilla ahk and a timer.
Left::
If(keyPressed = 1){
...Do a thing...
}
return
!Q::
keyPressed := 1
SetTimer, altQTimer, 200
return
altQTimer:
keyPressed := 0
return

How to keep spaces at the end of AutoHotKey snippets?

How to keep spaces at the end of AutoHotKey snippets? No matter how many I place in my ahk file, no spaces are present on execution.
Add {space} at the end of the command,
e.g.
Send myName{space}
Send abc{space 2} ; add 2 spaces after abc
Depends on your needs, but usually you can use the built-in variable %A_Space% for that.
Alternatively, you can add an escape after your space like this:
:*: ive :: I've `

Remove auto modifier from hotkeys

Is there a way to make a hotkey with a modifier that doesn't automatically put the modifier on the output key? ex: ^a::b -- except, when I hit ctrl+a it just gives me ctrl+b, when I just want ctrl+a to = b.
Playing a game which for some reason won't let me use hotkey ctrl + keys so I'm circumventing the issue by setting the hotkeys as something out of the way then setting the actual hotkey I want to those keys in autohotkey.
Try:
^a::
Send, b
Send, c
Send, d
Return
or
^a::Send, bcd
Could you show the exact text of line 4 that causes the error?

Sending a command when the shortcut exists

I've got a global command like this
!i::Send {Up} (pressing alt+I will move the caret up)
There is an application that uses Alt+I as a shortcut for an action that I'd like to call while still retaining my own custom shortcut. I'd like to remap this app's action to Ctrl+I
Within a proper WinExists, I've tried ^i::Send !{i} but that just moves the caret up.
I tried ^i::!i but that sends Ctrl+Alt+I and not Alt+I.
Any ideas? Thanks
Gabe,
Try this...
SetTitleMatchMode, 2 ; Accept the title search string to be found anywhere in title
#ifWinnotActive yourappname ; use windowspy to find a unique title string
!i::Send {Up}
#ifWinActive
This will set !i to behave just like you want in ALL programs except for the one you want to keep the special behaviour.
Alternatively, you could add a $ to the triggers, so they will not call each other like this:
$!i::Send, {Up}
$^i::Send, !i
After each command, you need to add the command return. So if you have the code:
!i::Send, ^i
return
^i::Send, !i
return
The code above inverts the functions of CTRL + i and ALT + i.

how to send a letter as itself when it is used as hotkey in autohotkey

For example I want press 'v' to get 'asdfv' by autohotkey, but when I define like the below :
v::send asdfv
the script run into an infinite loop, because the last v is covered as the shortcut. So the question is, how I can get want I want.
Two ways:
#UseHook On
v::send asdfv
or
$v::send asdfv