Autohotkey: How to get a command to act as a key?

0

Due to two keys being broken I want to be able to make the 'I' and 'O' to be mapped to a command, so for example mapping 'O' to ALT+P or something.

Thanks (noob at autohotkey)

Jack Quinn-Leitch

Posted 2014-12-26T15:04:04.553

Reputation: 1

Answers

0

Remapping in AutoHotKey or AutoIt follows the syntax

a::b

where a is the key or key combination to press (action) and b is the key that is send to your application (reaction)

There are 4 modifier keys which can be combined with a base key. You cannot combine two base keys at once in an easy way (However, it is possible). If you want to combine a key with a modifier, you simple put its symbol in front of it

  • # stands for WIN
  • ! stands for ALT
  • ^ stands for CTRL
  • + stands for SHIFT
  • * stands for any of the four modifiers

To remap ALP+P to O you would use

!p::o

Tips

  • If you don't want to block the native key function of ALP+P you put a ~ sign in front like ~!p::o

  • Function keys and special keys like F1 or arrow keys are accessed with curly brackets: {F1}

  • If you want to disable a certain a key, then you map it to return like a::return

  • Beside the normal mapping you can also use Send like a::Send {LAlt}

Further Reading

nixda

Posted 2014-12-26T15:04:04.553

Reputation: 23 233