Learn AutoHotKey by stealing my scripts
hillelwayne.com
hillelwayne.com
`::
IfWinActive Untitled - Notepad
WinClose
else
IfWinActive *Untitled - Notepad
WinClose
else
IfWinExist Untitled - Notepad
WinActivate
else
IfWinExist *Untitled - Notepad
WinActivate
else
Run Notepad
return
I think auto saving of unsaved documents is one of it's best features
That would defeat the point of having the notetaking window open instantly.
fyi, if you use the WinActive() or WinExist() functions you can combine different titles
If WinActive("Untitled - Notepad ahk_class Notepad") or WinActive("*Untitled - Notepad ahk_class Notepad")
maybe you don't have to put in the "ahk_class Notepad" bit, its been a while since i used ahk!
Btw, for use-cases when you need to keep the "toggled" window opened and do not want to close, minimize or hide it or something and just need the fastest flip to, flip back to previous window "toggle", super useful but (for me) long time forgotten native Windows hotkey is *`Alt + Escape`* - it simply switches to previous focused window without even showing window overview (like Alt+Tab).
So AutoHotkey *v1* boilerplate for such switcher/launcher then could be something like:
; Toggle <...> window using Ctrl + Shift + Win + <key>
^+#<key>::
_bckTMM := A_TitleMatchMode
_bckDHW := A_DetectHiddenWindows
SetTitleMatchMode, 2
DetectHiddenWindows, On
ifWinExist, <... window title fragment>
{
ifWinActive
{
send, !{escape}
}
else
{
WinActivate
}
}
else
{
run, <... launcher>
}
DetectHiddenWindows, %_bckDHW%
SetTitleMatchMode, %_bckTMM%
return
Or if you do not want that window to clobber the taskbar, you can use `WinHide` instead of that Alt+Win `send, !{escape}` and add WinShow to WinActivate, but it does not work well with some kinds of windows. Also for window detection it may sometimes be more suitable to use `ahk_exe` or `ahk_class`.I do include Minimize-if-already-active though. I like to be able to temporary flip an application into focus (e.g. Outlook) and then return to what I was previously working on.
Plus a tweak: When launching, programs may open in the background because Windows attempts to prevent applications stealing focus when you are working in another program. I overcome this by focusing the tray before launching.
and here's where I declare most of my hotkeys: https://github.com/diogotito/autohotkey-scripts/blob/desktop...
It uses AHK's window groups. I only regret having written this in AHK v1, which was a bit of a pain in the neck. I intend rewrite them in AHK v2, which looks like a halfway step to ES6 with lambdas, closures and all. So many quirks gone! I tried it a bit and it felt more fun and productive.
As a simpler alternative (which I use for work), one can pin the 10 most used applications on the taskbar and do:
- Win+<N> to launch, toggle, or choose a window from the Nth application
- Ctrl+Win+<N> to launch, toggle or cycle through the windows from the Nth application
- Shift+Win+<N> to launch a new window
- Alt+Win+<N> to bring up the Jump List
Then you can use a simpler hotkey manager (like PowerToys' Keyboard Manager) to bind to the Ctrl+Win+<N> shortcuts.
> Plus a tweak: When launching, programs may open in the background because Windows attempts to prevent applications stealing focus when you are working in another program. I overcome this by focusing the tray before launching.
Aaah! That explains some things. That does happen to me sometimes and it's a bit annoying. I got used to pressing my hotkey again when I noticed the taskbar icon blinking green to bring up the new window, or just spamming WinActivate and hope for the best. Thanks!
start "" "C:\...\7+ Taskbar Numberer.exe" -v2 -hidewnd
will show same number for grouped windows so cycling will work.Btw most tabbed interfaces have the same bindings for focusing first, second ... last tab (Ctrl+<number> in most browsers, Ctrl+9 for the last tab, usually).
I like to apply same "tab principles" to taskbar, so last thing missing here is to be able to "Ctrl+PgUp/PgDown" through windows in Taskbar order just like in sane browsers (with Win in place of Ctrl).
I attempted to do it with AHK but failed miserably, but luckily another third-party app, (7+ Taskbar Tweaker, from the same author as Numberer) can do that through advanced settings. Config in gist: https://gist.github.com/myfonj/62b4e0d393f4a97df5e9904df5e77...
(Sadly, none of those will probably ever work outside Windows 10 (?))
Pressing alt + win key does nothing for me on this Windows 10 machine.
`Alt + Escape`, that is. Thanks for pointing it out. Corrected.
(You see, I almost never use this shortcut directly, b/c I only exploit it in those AHK scripts to do the "to previous" flip without doing any additional persistence or querying in the script, so I messed up when recalling it. In fact I thought it was `Win+Escape`, tried it, found out it was `Alt+Escape` instead, and then finally wrote `Alt+Win`. Bad braining today.)
Would be cool if it opened a single "notes.txt" document instead. That way you could bring up your notes, append what you want, and save/close it with a single hotkey.
https://www.joelonsoftware.com/2000/04/10/controlling-your-e...
Run (A_WorkingDir . "\Config\Notes\" . this.NoteType . ".txt"); It is made in Autohotkey2.
`:: ; Tilde key
{
If WinActive("Untitled - Notepad") or WinActive("*Untitled - Notepad")
WinClose
else
If WinExist("Untitled - Notepad") or WinExist("*Untitled - Notepad")
WinActivate
else
Run "Notepad"
}I found ahk python module [2] but combining it with the keyboard module doesn't work as well as autohotkey as a hotkey listener.
[1]: https://github.com/idbrii/daveconfig/blob/main/win/autohotke... [2]: https://pypi.org/project/ahk/
:-)
(I am in the process of doing this inside OpenSCAD.)
Windows: https://github.com/randyrants/sharpkeys
Ubuntu Linux (don't know about other Linuxes): /usr/share/X11/xkb/symbols/pc
key <CAPS> { [ Caps_Lock ] };
-> key <CAPS> { [ Control_L ] };
These solutions avoid needing to keep a keybinding application open. The Linux solution unfortunately resets after every version upgrade.1. Do your multiline hotkeys have `Return` in them, or are they in braces?
2. Do you write `Send Foo` or `Send "Foo"`?
If you're doing the former, then I really recommend upgrading to v2, it makes a huge difference.
Dreams of a universal hotkey listener you could use in any language via some wasm plugin magic?
I configured Irfanview to monitor a folder and always show the newest picture.
Wit AutoHotKey I made a simple GUI with 3 Buttons. Preview, Autofocus and "SNAP". Preview brought up the camera software in liveview mode. Autofocus triggered the Autofocus. "SNAP" brought up a large countdown, at 0 it triggered a photo. The it minimized the camera software and brought up IrfanView. After a few seconds it "reset" itself, so IrfanView got minimized and my button GUI got brought up again. My guests loved it and I saved hundreds of Euros for renting a photo box and I got great images out of it.
;; Text–only paste from ClipBoard
;; (https://autohotkey.com/board/topic/10412-paste-plain-text-and-copycut/)
;; ctrl + shit + v
^+v::
Clip0 = %ClipBoardAll%
ClipBoard = %ClipBoard% ; Convert to text
Send ^v ; For best compatibility: SendPlay
Sleep 150 ; Don't change clipboard while it is pasted! (Sleep > 0)
ClipBoard = %Clip0% ; Restore original ClipBoard
VarSetCapacity(Clip0, 0) ; Free memory
Return
[Edit: tried to fix formatting]would also love to get a mult-value clipboard (e.g. my last 5 clips) but... that's asking a lot i guess. ;-)
cmd-space, cmd-v,cmd-a,cmd-x (buffer is now stripped)
https://support.microsoft.com/en-us/windows/clipboard-in-win...
..is there a way to bring that back?
I have cmd-shift-v mapped to my clipboard history which is fully searchable, I use Raycast on Mac but I would wager there are Linux and Windows alternatives.
for the latter programs having the default be paste with formatting seems fine. yes, i'll paste stuff from the web without formatting. But copying/cutting/pasting within the same document is also a pretty common interaction and if i'm cutting something non-trivial (eg. google docs table/nested lists), i don't want to paste it back into google docs as a bunch of regular, separate lines.
SendInput {Raw}%ClipBoard%`I only wish it had the capability to use a second keyboard as a button surface to trigger stuff while eating up those key presses, so I'm resorting to a small bluetooth keyboard connected to a raspberry pi zero in order to get more buttons.
Apparently there is also this: https://github.com/evilC/AutoHotInterception
> Let's officially state what has been a reality for the last several years. I don't use Hidmacros/Luamacros any more and have no interest in improving it or even fixing existing bugs. I invest my personal time in other things which are more interesting for me now. So please don't expect any support from my side. I'm also removing all donation buttons.
Hammerspoon[1] seems to be the best option for macOS.
I switched to a 90% Windows environment at my new job. Gave Windows + AHK a shot to potentially reduce headaches when IT issues would pop up.
I couldn’t do it. AHK’s syntax is ridiculous, and whenever I would try to download and trial scripts I had to infer if it was v1 or v2. I switched back to the Mac with KM and am much happier for it.
Is there anything like KM for Windows??
you need multiple programs on linux to do something similar to ahk and nothing ive tried has come close to how simple ahk is or how you can make complex key mappings with it.
i have got into python though and have been able to do some fun stuff with that so there's that at least
Why is that? Is there something about Linux that makes it difficult to do all the stuff AHK can do on Windows?
I have a Preonic keyboard running QMK[1] and have a dedicated MIDI layer so I can still use it as a regular keyboard if I want to. I then use dannywarren/AutoHotkey-Midi[2] to listen for hotkeys.
This has been way more reliable for me than listening for trying to use hotkeys like Ctrl-Alt-F13 or things like that, as they'll never conflict with something I might be in the process of typing. The only catch with that is if you want to use AHK to send keystrokes to a process running in elevated access, you'd need to start your AHK script as Administrator. That hasn't had an impact on me, though.
- Insert date/timestamps shortcut (6 different formats, including ISO, and filename-friendly)
- PuTTY/SSH launcher shortcuts for often used hosts and serial ports
- Stateful DWIM Application Launcher for 10+ applications, e.g. Outlook (Win+O), Windows Terminal (Win+Space), Total Commander (Win+T), etc. (Either launches, activates, or minimizes depending on current state)
- Paste clipboard in plaintext (no format) in any aplication (Win+V)
- Paste clipboard removing newlines in any application (Win+Alt+V)
- AltGr input layer for special characters (æøåµΩ° and some emojis)
- Media & Volume shortcuts (start/stop/next, volume up, volume down)Spotify responds to Send {Volume_Up}/{Volume_Down}.
Any particular reason using Cmder and not Windows Terminal?
At work, I have no option to install Powertoys or Uncap[2] for that matter. AutoHotKey is the only way, but I'm unable to get it to work. I used this StackOverflow[3] answer, but with this, both Caps Lock and Escape send both of the keys. So I'm stuck occasionally messing up my Teams messages :)
[1]: https://github.com/microsoft/PowerToys [2]: https://github.com/susam/uncap [3]: https://stackoverflow.com/questions/38558376/how-to-map-caps...
[1] https://superuser.com/questions/550679/where-can-i-find-wind...
I'd also suggest "home row modifier keys" (or "home row mods").
The idea is to have the key behave the same when tapped, but differently if held. (e.g. https://github.com/evilC/TapHoldManager implements this for AHK)
With home row modifiers, Shift/Ctrl/Win/Alt are put underneath fdsa (and jkl;). -- This reduces the need to use pinky fingers for these keys, & the fingers get to remain on home row more.
CapsLock::Esc
Esc::CapsLock
I wrote about a number of other AHK quick wins, such as launching programs with global hotkeys here: https://nickjanetakis.com/blog/remap-and-set-global-hotkeys-...https://github.com/hwalinga/dotfiles/blob/master/CapsLockCtr...
It also implements the double feature functionality of CapsLock that now functions as Ctrl when pressed with another key, and just Esc when tapped.
However, the AHK language is not the most pleasant to use.
That leads to question why isn't there something as powerful available in Python or say Lua. Yes there is https://github.com/pywinauto/pywinauto but in practice it did not work as well as AHK.
It is just WinAPI underneath so C# would be another choice if there was a nice wrapper library.
I guess the answer on why AHK is so popular is that it is ugly but it works.
When held down with any letter, it switches through the instances of that app. For example, Alt + C switches to VS Code window. Alt + F keys opens new instances of an app such as a new Chrome window in a specific profile.
Alt + number are configurable and can be set for the current window in focus. By tapping Alt, the "edit" mode is enabled, allowing me to set the current window as any of the number keys.
When in "edit" mode, the H,J,K,L keys also switch to navigation, becoming up, down left, right etc.
It makes switching between apps so much faster.
https://github.com/hwayne/autohotkey-scripts/blob/main/Lib/WindowSwitching.ahkThe script would bind your analog move to a little circle around the player, allowing you to smoothly run in any direction. You could then press a button to alter the range to distant for casting abilities further away. With just a bit of customization per class it worked amazingly well.
The AHK documentation is really good, and is a windows help file (chm). It is really fast, has a good enough indexed search, and example code is usually present.
The alien syntax, the incompatibilities between versions, the outdated information on the internet made it difficult to learn.
I'd recommend to just use python with a library like pyautogui and similar.
Took me a while to figure out a decent environment for it: VScode with Autohotkey Plus Plus extension, which allows debugging.
+chatGPT is super useful for it.
so don't get discouraged. If you want to learn coding I'd recommend learning python on some online code editor which requires zero setup. lookup 'python online', there are many websites for it. also Google Colab is awesome
maybe you just need to search online more or refine you searches. when i was learning ahk first i would nearly end up searching nearly every little thing i needed to do, and there was always a forum post with the answer or part of the answer
The most useful thing I’ve made: Select text anywhere and press ctrl-shift-1. Select text somewhere else (even in another application) and press ctrl-shift-2. Press ctrl-shift-3 and my graphical diff tool opens to show me the differences.
I've written more then 5000loc long program that plays an MMO for me!
It can already do most of the content that's in the game, but there still a lot of improvement needed.
But the development was so fun, every night I would start the script and then when I woke wake up, I would see where it broke and could then try to fix it and test it again the next night (because a lot of in-game content rests daily).
When I started writing the program, I was looking around to see if there's a library for Rust that would give me the same or at least similar functionality, but sadly I didn't find anything.
Don't get me wrong AHK is amazing, I just wanted to use the coding of this program as a way to better learn Rust!
I even had the program write a CSV file so that I could track the effectiveness of farming.
It really is incredible how powerful and easy to use AutoHotKey is!
If the game is boring enough that it can be played by an ahk script, then it probably isn't the most interesting game in the first place.
The ahk game sounds like more fun to me.
I would position part of what made Diablo 2 (not remake) last so long was bots on the ladder and the shops that provided the bots; no one "new" was playing the game at that time and everyone had "fair cheats" for rushing through the first two game modes [0] [1], and everyone had been using the "fair cheats" for years since they had been discovered. But the fair cheats needed other players to pull off, and this wasn't always reliable.
When the D2 shop farmers started botting, they realized it would be great advertisements to do specific types of common runs for leveling with the bots; the bots would grab any item worth value, but typically they just would repeatedly run common leveling/item farming areas on a predictable and guided schedule, dropping quick announcements about the shop in chat periodically (maybe several times per run which is usually around 5-15 minutes, and it was just a quick stylized message in the game chat.) There were enough bots that it wasn't flooding the available games to join, but you could almost always find a bot game to join and just follow until you were leveled.
Most players did this to get through Normal mode and often nightmare, as everyone just wanted to get a character ready for late Nightmare/Hell which is when the game is "fun" (better drops, more difficult monsters to fight, it was the point at which the game gets interesting in general for most players)
Without the bots and players "cheating" through the first 2 game modes, I'm not as confident people would have keep playing as long as they did. It wasn't "unfair" in my opinion as everyone had always wanted this, and it had automated what everyone was already doing; I'm not sure I see the difference between using AHK like the GP did and having a setup like what D2 had
0 - For the unfamiliar, Diablo 2 had three modes: Normal, Nightmare, and Hell; same game each time, but item drops are better and monster levels are changed to be more difficult, with monsters getting better attributes that made them more difficult. I am going to make a generalized statement that for most players, the game really begins at Nightmare if it's not one of your first few times playing the game
1 - By "fair cheats" I mean the game was exploited to ensure fast leveling without a lot of effort and also ways of bypassing the "boring" parts of the game that the game allowed, but likely not intentionally. Blizzard definitely couldn't solve this in game without substantial reworks, which they probably didn't want to do
Early on that's how it was, but later on they figured out glitch rushes (grushes) to help you fly through a1-a3 and you'd usually just trade your forge on NM/Hell for it.
After awhile though, this got really scammy from my experience (too many players who needed to be rushed would just flake)
Around 2018 or so when I played again, there were a LOT of shop bots running around doing the runs, and even better you had ENCHANT games where some suped up sorc would cast a ridiculously leveled ENCHANT on you (and your merc!) and even get you waypoints. I think I even remember the bots could do the grush, but I'm not confident I remember right on this element.
Basically, yes, old team-ups were great, when the player base was significant enough that you could do this :) In the last years of D2/LOD original, it was a little less possible to go that route.
The game should incentivize you to play and enjoy, not farm activity #399
There are also legitimate accessibility issues this can resolve, but would be considered cheating in many games.
that’s probably the definition of how most programmers got started. Get off your high horse
As such even if you were to automate every part of the game that's you can do as a free to play player you couldn't get close to those that support the developers with their money.
The gap is so big that you can't even hurt those players where as they can pretty much kill you in one shot.
But I personally play the game because of the people and the community, so none of the automation or money spending really matters to me.
Sadly a lot of games nowadays have (shitty) anti cheat systems that just ban you if you have the process running or have the program installed
Interesting, that's how I got into AHK and programming in general too. It started as a simple timed clicking script, then became dynamic enough to handle variable timings, then I sped it up by embedding compiled machine code from a C function into the script as hex, decoded into a buffer, and called it with DllCall so more computer resources could go to running the game rather than the script. I went into more detail about my story here: https://news.ycombinator.com/item?id=23160930
- ctrl+alt c / n / s for calc / notepad / snipping tool
- toggle "always on top"
- send to "other" monitor (I have a 2 monitor side-by-side setup)
- turn a Youtube "shorts" url in to it's regular Youtube page "watch" version via URL manipulation
- remap ctrl+shift+c to do nothing, instead of very slowly opening Chrome dev tools when I miss ctrl+shift+v "paste as values" in my huge Google spreadsheet
(Windows recently got bunch of keyboard shortcuts, some overridable, some not. Sometimes you can discover them only with your AHK disabled, since you might have overriden them in the past...)
I used AHK to script a process that would automatically add laptops to our cart based on certain search criteria. Then we could sift through their inventory and release what we didn't want.
It was running great until one day it went rouge (okay, was prob human error) and it added EVERY item to our cart and crashed their website. Database error came up, I called them and told them what I did and they were happy to know why it went down.
You'd think I'd learn but my scripts usually start small for with one specific use and i enlarge it Unsafely once I think of another use for it
Loops are my danger zone. After a few crashes the first guardrail I end up adding to a script is a stop key combo interrupt. Then figure out what bounds to put only after every mistake. I don't have the foresight to prevent "rogue" behavior
To avoid [infinite loops] add the $ prefix to the hotkey definition (e.g. $^c::) so that the hotkey cannot be triggered by the Send command.
or a very restrictive #MaxHotkeysPerInterval
I haven’t yet played with AHK 2 and ChatGPT, but since she has a cutoff at 2021, she may not know be well versed in AHK 2.0
It lets you do text expansions on any website using hotkeys, include dynamic values like the date a week from today in your snippets, build form UI's [2], and include dynamic logic using formulas and if-statements [3] (it uses a dynamic reactivity model for formula's similar to spreadsheets).
One thing we are really excited about currently is using Text Blaze snippets to connect any website to an Airtable/Monday.com like spreadsheet using a lightweight SQL variant we created [3]. Combined with forms and formulas, this allows you to build mini-apps you can use on any site with a hotkey.
[1] We're currently beta testing Mac and Windows desktop versions.
[2] https://blaze.today/guides/forms/
you write code line by line and the software expects to parse it one by one.
imagine my surprise when trying python for the first time and indentation error. WTF does indentation has to do with code?
i still cannot get over the fact that some interpreters and compilers and shit look at whitepace and go "this should be 4 space and not just 1 or 0. boo. wont run".
i get it, there has to be some form of beatification and stuff but why the hell wont the program run without proper indentation?
i have a problem at work, something tedious and my mind can think entire AHK programs. all i have to do is type them out and run.
i want to do a loop, i dont want to learn to be forced to understand indentation. that kills the enthusiasm imo.
Besides, I don't know what backwards IDE you used. I've been doing python for 15 years and have never had to manually indent squat, ever.
It sounds more like you didn't actually try python but read about the whitespace indentation somewhere and decided to chime in. Either that or you tried it in notepad.
once the code gets more elaborate, syntax highlighting and the likes do indeed make ones life easier
on one hand, it has the least amount of startup for a new programmer because it can teach you to do cool things. on the other hand, like me, the "habits" get wrong because i never learned to do pretty code.
That said, I'm in the camp of curly braces (or equivalent) plus an autoindenter. Either a code formatter or the editor itself.
Braces and random indentation is the worst that can happen.
I can recommend using Notepad2 if you want to use GP languages but don’t want to use an IDE (which is understandable as it brings a cognitive overload when you learn). Notepad2 is a drop-in replacement for Notepad, but may be installed as a separate app. It’s not particularly for programming, but has related features that Notepad should have had for ages.
^+b::SendRaw %clipboard%
I managed to coerce chat GPT to do a working version for the `Last Window`, but it simply cannot do a working forward version.
```
!+`:: ; Last window
WinGet, ActiveProcessName, ProcessName, A
WinGet, windows, List, ahk_exe %ActiveProcessName%
Loop, % windows
{
thisID := windows%A_Index%
WinGet, thisWindowState, MinMax, ahk_id %thisID%
if (thisWindowState = -1)
continue ; Skip if window is minimized
lastWindow := thisID
}
if (lastWindow)
{
WinActivate, ahk_id %lastWindow%
}
return
``````
; BRING FORWARD ALL WINDOWS OF THE CURRENT APPLICATION ; This is a generalized version of ; https://superuser.com/questions/113162/bring-to-front-all-wi...
^!`::
WinGetClass, class, A
WinGet, id, list, ahk_class %class%
Loop, %id%
{
this_id := id%A_Index%
WinActivate, ahk_id %this_id%
; MsgBox, The active window's this_id is "%this_id%".
}
return
; MINIMIZE ALL WINDOWS OF THE CURRENT APPLICATION
^!m::
WinGetClass, class, A
WinGet, id, list, ahk_class %class%
Loop, %id%
{
this_id := id%A_Index%
WinMinimize, ahk_id %this_id%
}
return
; CYCLE ALL WINDOWS OF CURRENT APPLICATION
; Pull bottom window to the top, and force it to display
^`::
; need Process and Class to restrict to current application
; most apps have unquie window classes, but Chromium based apps
; share their primary window class. Thus Google Chrome, VS Code and
; Electron based apps all looked the same using only `class`
WinGet, Active_ID, ID, A
WinGet, Active_Process, ProcessName, ahk_id %Active_ID%
WinGetClass, class, A
WinGet, id, list, ahk_class %class% ahk_exe %Active_Process%
lastItem := id%id0%
lastItemId := id%lastItem%
WinActivate, ahk_id %lastItemId%
WinSet, Top,, ahk_id %lastItemId%
Winset, AlwaysOnTop, On
Winset, AlwaysOnTop, Off
return
; CLOSE CURRENT WINDOW AND ACTIVATE NEXT WINDOW OF CURRENT APP
; similar to the CYLCE ALL WINDOWS OF CURRENT APP, but closes the
; current window.
;
; Because some Apps have Tabs that are closed via the same `^w` shortcut,
; we only switch to the next active window if the current window no longer
; exists after sending `^w`
;
; RATIONAL: This makes the Application Context a little more like macOS
; where closing windows leaves you in the current application, and not
; a random window that is the next in the stack.
$^w::
; need Process and Class to restrict to current application
; most apps have unquie window classes, but Chromium based apps
; share their primary window class. Thus Google Chrome, VS Code and
; Electron based apps all looked the same using only `class`
WinGet, Active_ID, ID, A
WinGet, Active_Process, ProcessName, ahk_id %Active_ID%
WinGetClass, class, A
WinGet, id, list, ahk_class %class% ahk_exe %Active_Process%
lastItem := id%id0%
lastItemId := id%lastItem%
Send ^w
Sleep 50
WinGet, Current_ID, ID, A
If (Current_ID != Active_ID) {
WinActivate, ahk_id %lastItemId%
WinSet, Top,, ahk_id %lastItemId%
Winset, AlwaysOnTop, On
Winset, AlwaysOnTop, Off
}
return
```Should be mandatory at law firms, for example.
I learned that you could click buttons before they were even drawn on the screen.
^WheelDown::
{
return
}
^WheelUp::
{
return
}
(this possibly needs A_MaxHotkeysPerInterval := 2000 )-----
<Caps> + a = ä.
<Caps> + <Shift> + a = Ä.
... and so on with all the German letters and currency symbol.
As a bonus, <Caps> on its own is mapped to "find" (Ctrl + F)
and <Caps> + f runs Send "{Space}datemodified:this year -kind:=folder", for when you have a lot of historical documents and want to get quickly on with the most recent using Microsoft's bafflingly stupid search operators. (Caveat, you have to switch to "last year" in January.)
Anyway we can achieve this?
https://support.microsoft.com/en-us/office/connect-to-third-...
For everything else, you can either parse a log (have fun!) or ask your AD admin to create credentials so you can use graph API after an OIDC handshake (also have fun!)
It clicked on pixels of a certain character in game to thieve an NPC, and could detect full inventory, bank and go again.
I've now switched to a qmk compatible Keychron V2 (65%) keyboard and remapped the keys exactly the same way. I'm very tempted to go back to a more compact 60% since I literally never use the arrow keys.
When I use my laptop on the go, AHK to the rescue. I found a script[0] that does almost the same thing, unfortunately, it fails when I use more than one modifier with the arrow keys. For example: shift + ctrl + left arrow to select one word to the left, which is shift + ctrl + caps lock + h in my case, doesn't work.
[0] https://github.com/AlexP11223/hjkl-keybindings/blob/master/w...
Alternatively, do you have a favorite key sequence pattern that usually works? The linked scripts seem to use stuff like “;.” which is pretty clever. Semicolon isn’t usually followed by anything except space.
It would be nice if keyboards had an equivalent of 127.0.0.0/8 where you know nobody else is listening for a key combination in that range.
Interesting. What is the reason for doing that?
- KeyboardMaestro is pretty equal, but is paid and takes a more gui-centric approach to automation building. Definitely more user-friendly.
- BetterTouchTool has a lot of intersecting features, but is more catered to gui scripting and gestures.
- Alfred has introduced automation scripts and triggers.
- There is also Shortcuts, which is sometimes quite odd to use and limited, but has the advantage of Workflows working on mac and iOS/iPadOS.
Keyboard Maestro has a great interactive UI, and also built-in UI panels that are also great as "cheat sheets"
BetterTouchTool is superb in touchpad/mouse control (but can also do shortctuts)
Nowadays I'm on macOS and I use BetterTouchTool and karabiner-elements to handle all kinds of miniature efficiency patches, and they make a huge difference for me. BTT in particular allows for a limitless amount of system control, such as triggering context menu actions, running AppleScript, or even showing/hiding a floating WebView of your own HTML document. I've barely scratched the surface.
My old suite had:
- Universal VIM movement w/ CapsLock
- App launch hotkeys
- App-specific hotkeys
- Easy text-expansion
Hasn't been updated in years, but here is the repo for those interested: https://github.com/denolfe/autohotkey
Or a nice boilerplate to start from: https://github.com/denolfe/AutoHotkeyBoilerplate
The README contains layout diagrams if anyone's interested.
>^v:: SetKeyDelay, 10, 10 SendRaw %clipboard% Return ; this version types it with a larger delay to account for latency >^+v:: SetKeyDelay 500, 10 SendRaw %clipboard% Return
I think AHK has really easy onboarding, meaning you can get tremendous low-hanging benefits out of it minute after installation -- you open the help, do your first `::btw::by the way` hostring, map reloading the script to `^+!r::reload` and from this point on you iterate quite rapidly, progressively fixing your easily fixable pains -- but sooner or later, after reaching some level of complexity, things begin to get hairy, not worth the effort or even impossible.
But as as say, there is vast amount of simple shenanigans you can make with basic AKH functionality, most of them you can even make on your own just with the help file.
Few years back, I made a video and published a free downloadable AHK template.
https://www.learnqtp.com/get-productive-with-automation-auto...