Editing
AutoHotkey
From Deskthority Wiki
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Infobox software | name = AutoHotkey | title = | logo = [[File:AutoHotkey logo.png]] | logo caption = | screenshot = <!-- [[File: ]] --> | caption = | collapsible = | author = | developer = | released = <!-- {{Start date|YYYY|MM|DD|df=yes/no}} --> | discontinued = | latest release version = | latest release date = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --> | latest preview version = | latest preview date = <!-- {{Start date and age|YYYY|MM|DD|df=yes/no}} --> | frequently updated = <!-- DO NOT include this parameter unless you know what it does --> | programming language = | operating system = [[Microsoft Windows]] | platform = | size = | language = | language count = <!-- DO NOT include this parameter unless you know what it does --> | language footnote = | status = Active | genre = Utility software | license = GNU General Public License 2 | website = {{URL|http://www.autohotkey.com/}} }} '''AutoHotkey''' is a keyboard remapping and macro language utility for [[Microsoft Windows]]. AutoHotkey's syntax spans all the way from trivial declarative mappings up to fully-fledged procedural, graphical software development with the ability to make Windows API calls. ==Key remapping== The following script performs the much-desired ability to swap the [[caps lock|caps lock key]] and [[control key]]: Capslock::Ctrl LCtrl::Capslock Caps lock becomes a control key, and the left control key is now caps lock. Right control remains unaffected. ==Extended character entry== '''AutoHotkey_L''' in particular is useful for permitting the entry of any Unicode character at the keyboard (in Unicode-aware applications) from simple keyboard shortcuts. For example, the following AutoHotkey script binds ctrl+alt+N to right arrow ("β", U+2192) and ctrl+alt+M to a true minus sign ("β", U+2212): ^!N::SendInput {U+2192} ; ctrl+alt+N = right arrow ^!M::SendInput {U+2212} ; ctrl+alt+M = minus While this sort of character entry has been available on the Macintosh for decades, AutoHotkey_L extends this concept out to the full 32-bit Unicode repertoire. ==Operator's guide== '''The most advantageous thing''' about AutoHotkey is its '''portability.''' A script compiled into an ''.exe'' stands far higher chance of being allowed to run on corporate/guest computers than would a custom MSKLC-layout-installation, for example. A second advantage is that you can customise how ''any'' key or key-combination works. For example: :You can turn ''C'' into a ''P'', but keep the ''Ctrl+C'' command working as normal! When learning to script AutoHotkey, make a habit of always checking the documentation on the AutoHotkey website. It's all there, in one form or another. ===Reliability=== AutoHotkey has a somewhat poor reputation concerning its reliability, but this is not as much of an issue lately if at all. All input events used to be generated with the commands SendEvent and SendPlay, with their respective advantages and disadvantages. The newer command SendInput is much more reliable, is not a hog on the system and has no chance of being interrupted by other system events. ===Starting out with AutoHotkey: The basics=== Specify ''SendMode Input'' at the top of the script if it isn't there (it's there by default in all new scripts). That way the Send command translates into SendInput, which is well desired for performance and reliability. In AutoHotkey_L this is default and does not need specifying. <sup>[unconfirmed]</sup> A basic remap in AutoHotkey script is done with this shorthand: a::o which makes pressing "a" send the "o" event to the system. (Pressing "o" will still send "o" unless you remap that key too). All modifier states are remapped along with this: for example, Ctrl-A will appear as Ctrl-O to the computer. Remember that even as you remap, AutoHotkey knows which keys you really mean: always type the key's original ''QWERTY'' position. ===Remapping several times=== :<p style="color:#616161">''DISCLAIMER: The author who wrote this is rusty. Someone confirm it's correct.''</p> Remember that if you remap one key several times, the script is sensitive to the order in which you place them. The higher-up line has greater priority than the lines below. For example: +[::Send +[ [::( This turns bracket " [ " into parenthesis " ( ", but keeps the gull-wings sign " { " just where it was. Here you also see the " + " prefix being used. It specifies that Shift needs to be pressed for the hotkey to trigger. This is not always necessary: you can just type A instead of +a in most cases. Some characters are used in AutoHotkey syntax, like the gull-wings, and can therefore not be used in this context. " + " specifies Shift, " ^ " specifies Control, " ! " specifies Alt. " ^>! " or " <^>! " specify AltGr for those that have it, but it can be tricky to get it to work in all situations. Recommend switching to US layout and making RAlt (" >! ") your 'inofficial' AltGr. That is not to say it's not possible to make it work flawlessly, but you need to be a skilled AutoHotkey scripter to do so. ===Making hotkeys act as they do on ''QWERTY''=== Some people complain that common hotkeys, such as Ctrl-C, get relocated to uncomfy places when learning a different layout. This issue is easy to remedy if you use AutoHotkey: ^z::Send ^z ^x::Send ^x ^c::Send ^c ^v::Send ^v This way your cut, copy, paste functions are in the same places as before, even if the letters they'll print out are different. If you have remapped your keyboard with other media than AutoHotkey, change the left side of the "::" to match whatever keys are in those positions on your remapped layout. [[Category:Utilities]]
Summary:
Please note that all contributions to Deskthority Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Project:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Infobox
(
edit
)
Template:Infobox/row
(
edit
)
Template:Infobox software
(
edit
)
Template:URL
(
edit
)
Navigation menu
Page actions
Page
Discussion
Read
Edit
Edit source
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Navigation
Main page
Deskthority forum
Support Deskthority
Search
Main categories
Guides
Keyboards
Keyboard switches
Keycaps
Keyboard modding
Pointing devices
Brands & companies
Group buys
Other topics
Wiki info & links
Recent changes
Random page
All pages
Deskthority wiki help
MediaWiki help
Tools
What links here
Related changes
Special pages
Page information