As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [autohotkey]

AutoHotkey (AHK) is a free, open-source macro-creation and automation software for Microsoft Windows that allows users to automate repetitive tasks. It is driven by a scripting language that was initially aimed at providing keyboard shortcuts, otherwise known as hotkeys, that over time evolved into a full-fledged scripting language.

Filter by
Sorted by
Tagged with
1 vote
2 answers
1k views

Auto close program after X seconds inactivity (in that program)

Using AutoHotkey, I want to auto close a program (e.g. Firefox) after X seconds of inactivity (in that program--i.e. mouse or keyboard activity possibly elsewhere, but none in that program). What code ...
user2356098's user avatar
1 vote
1 answer
252 views

Fix repeated keystrokes without destroying AutoHotkey scripts?

I have a mechanical keyboard problem where sometimes 1 keypress registers as 2. I solved this by installing Keyboard Chattering Fix and setting a minimum 50ms delay requirement between key presses. ...
Jase's user avatar
  • 223
0 votes
1 answer
141 views

Autohotkey-COM-Youtube : How get channel id from url?

I can get the video name using this code. But to get the channel id I change the "title" to "channel_id" but it doesn't work... I want to get channel id instead of title MsgBox, % ...
emreya's user avatar
  • 43
0 votes
1 answer
330 views

Is it possible to intercept a 'open file' event in windows and replace the default opening application with something else?

Suppose I have two .pdf files. One is a comic book and the other is just a document. The behavior I want to achieve in the end is when I double click on the comic book, it will open the comic book ...
Curtwagner1984's user avatar
1 vote
0 answers
184 views

How to Pin to Bottom/Desktop UWP Application Using AHK Windows 10

I'm aware of using setParent from DLL in Windows and I can pin Win32 application on Windows already with this script #o:: Current := WinExist("A") ;ParentID := WinExist("ahk_exe ...
Benyamin Limanto's user avatar
0 votes
1 answer
286 views

How to make space act like as if it were a new modifier key like alt, shift, ctrl

How do I make the space key (or any other non-modifier key) act like a modifier? For instance when I hold down space and press h, it should e.g. print "hello".
Sebastian Nielsen's user avatar
0 votes
1 answer
682 views

Map Caps Lock to Backspace and Caps lock to Some other shortcut using Autohotkey

How can I turn caps lock to backspace using autohotkey? I also want to add some kind of shortcut to toggle caps lock by mapping shortcut like Shift + CapsLock. I am using windows 32 bit Standard ...
Lovish Garg's user avatar
2 votes
4 answers
2k views

How to assign a hotkey to enable/disable Focus Assist on Windows 10/11?

To my surprise, there seems to not be a Windows hotkey for enabling/disabling Focus Assist on Windows 11. Is there a way to force such a hotkey, even if it requires the use of third-party software (...
Aventinus's user avatar
  • 1,352
0 votes
1 answer
138 views

Can I override a specific key on my keyboard permanently to always enter the @ symbol?

The problem is (and this really sucks) that every so often (without apparent reason) the alternate keys are not working on my keyboard. I really tried EVERYTHING (keyboard layout, keyboard ...
Cyman's user avatar
  • 365
0 votes
1 answer
735 views

AutoHotKeky: Run a CMD command in the background

I would like to write an AHK script to be able to switch between portrait and landscape mode by a single key. Here is my first attempt not exactly what I am looking for. I am not an expert in the AHK ...
Handsome Nerd's user avatar
0 votes
1 answer
1k views

Autohotkey and Logi MX Master 3 on windows

this is what I'm trying to achieve using autohotkey: I want my keyboard buttons to be from: Ctrl + Win + Alt to Win + Alt + Ctrl And I can easily do that with autohotkey, but there is a problem: ...
Edoardo's user avatar
1 vote
4 answers
360 views

Is there a modified version of the United States QWERTY keyboard with more symbols?

I'd like to have the US QWERTY layout (so my keyboard still works,) but also have some addition symbols from other languages. It's almost like adding the Alt-Graph and it's features from the UK/Irish ...
DarkBrave_'s user avatar
0 votes
1 answer
573 views

How to automate a point-and-click procedure in Windows, involving tray icons and menus

I use ProcrastiTracker program to log activity on my Windows machine, and I'd like to export the data this program collects so I could analyze it further. Since there's no easy/built-in method to get ...
Emman's user avatar
  • 101
1 vote
1 answer
192 views

How to force Windows to use %USERPROFILE% when creating multiple shortcuts simultaniously (or achieve the same thing with AHK)?

The problem: Using dropbox at my work, my colleagues can't follow shortcuts I create. PS: I use "shortcut" (what Windows calls them) and "alias" (the Mac nomenclature) ...
Josh's user avatar
  • 159
1 vote
1 answer
890 views

AutoHotkey vs SharpKeys for remapping keys

Both AutoHotkey and SharpKeys can do key remapping, what're the differences between them when used for key remapping? Which one is more stable?
Wenfang Du's user avatar
0 votes
1 answer
183 views

`MouseMove A_ScreenWidth, A_ScreenHeight` loses precision

Quote from the documentation: A_ScreenWidth, A_ScreenHeight: The width and height of the primary monitor, in pixels (e.g. 1024 and 768). I expected the following code to move the cursor tip at the ...
Wenfang Du's user avatar
0 votes
1 answer
434 views

How to reassign the "Sign out" shortcut on Windows?

I often find myself mistyping the "Sleep" shortcut as "Sign out". So I want to disable the shortcut for it, i.e. Win+XUI: And reassign it to Win+XUO, how to achieve this using ...
Wenfang Du's user avatar
0 votes
1 answer
397 views

AutoHotKey - switch statement with a series of InStr functions

I have created an AutoHotKey script with a bunch of if functions that rely on InStr, similarly as in the example below, and it already does what I want. Is it possible, though, to convert it to a ...
autohotkeyuser's user avatar
1 vote
1 answer
581 views

Do I have to put `SetTitleMatchMode` on top of the script?

Sample script: #NoEnv #Warn #SingleInstance Force #IfWinActive Foo ahk_exe foo.exe !A::Send Foo SetTitleMatchMode Regex #IfWinActive Bar$ ahk_exe bar.exe !A::Send Bar When running it, it ...
Wenfang Du's user avatar
0 votes
1 answer
102 views

Tabs Outliner - Is it possible to minimise and maximise its window with Chromes main UI

In Tabs Outliner, the window stays put even though the main UI of chrome is minimised. See here the UI of the extension and Chromes showing what I would like. Is it possible in the settings or even ...
Ste's user avatar
  • 1,156
0 votes
1 answer
371 views

How to resolve a hotkey conflict?

I bound Alt+Space to an action, for example: !Space::Send, Foo Now how to trigger the original Alt+Space's action (as shown in the image below) through code?
Wenfang Du's user avatar
0 votes
1 answer
757 views

How to write an AHK script that uses a shortcut to close PowerShell?

I've known that Alt+Space C could close PowerShell, but Alt+Space is already in use for me, I want to bind Alt+F4 to Alt+Space C, how to achieve that in AHK?
Wenfang Du's user avatar
0 votes
0 answers
48 views

Block windows button in full screen

I use Windows 10 Pro. I like to play pc games and I hate getting interrupted when I accidentally push the windows button. I got a Autohotkey script that looks like that: #NoEnv ; Recommended for ...
NicolasB's user avatar
  • 111
0 votes
1 answer
118 views

How to bind an action if no dialog is open?

In VLC media player, I want to bind k to Space (Pause/Play) if no dialog (e.g. the preferences dialog) is open, how to achieve that?
Wenfang Du's user avatar
0 votes
1 answer
48 views

How to get the hotkey definition if a shortcut is pressed?

For example, if I press Ctrl+Shift+Alt+C in this order, how I do get the corresponding hotkey definition? I expect something like the following: ; pseudo code *::MsgBox %A_ThisHotkey% was pressed
Wenfang Du's user avatar
1 vote
1 answer
1k views

How to trigger an action if there's only one key being pressed?

Here's my current script: Shift::Send ^{Space} It doesn't only trigger ^{Space} on pressing Shift alone, it also triggers on Alt+Shift (just these two keys) and Ctrl+Shift (just these two keys) if ...
Wenfang Du's user avatar
0 votes
1 answer
56 views

How to combine Alt+Shift+1 into mouse right click

I am trying to combine Alt+Shift+1 to mouse right click with "AutoHotKey" in some online game. I know that ::send !+1 is alt+shift+1 but troubles in right click.
Thuriya Thwin's user avatar
0 votes
0 answers
373 views

Is there some way to limit the fastest mouse click input speed? [duplicate]

I'm having some issues with my mouse, a Roccat Tyon, in that it seems to be erroneously sending two rapid click inputs on a single click, for both left and right mouse buttons. I've updated my drivers ...
WhatEvil's user avatar
  • 184
0 votes
1 answer
146 views

Run .cmd file every x minutes when app is being used?

I'm trying to find a way to incrementally back-up a folder every 15 minutes, but only if VS Code has been used/in focus since the last time it was backed up. Does anyone have an idea for how I could ...
TheNomadicAspie's user avatar
2 votes
3 answers
351 views

Autohotkey: closing vlc media player

I want to setup a hotkey for closing vlc or windows media player using autohotkey. I came across this page in the guide- https://www.autohotkey.com/docs/commands/WinClose.htm But it doesn't seem to ...
batchcoding____s's user avatar
0 votes
1 answer
143 views

Map key "F1" to left click in mac

Map key "F1" on the external keyboard to left-click in mac What is the simplest way? Is there any built-in setting that could achieve this?
Luk Aron's user avatar
  • 177
2 votes
1 answer
462 views

AutoHotKey script switching between virtual desktop using ^!LButton and ^!RButton highlights one app from the start menu

I've created an AutoHotKey script which allows me to switch between virtual desktops more comfortably but there is a weird issue that makes a random (but most often the most recent) app ask for ...
JustAnEuropean's user avatar
1 vote
2 answers
622 views

Context switching out of Remote Desktop via keyboard command

Problem: I need to swap between the RDP context and the windows host context so that key commands like Alt+Tab and Win work as intended in their given environments. Environment: I'm running Windows ...
Jakob Lovern's user avatar
1 vote
1 answer
901 views

How to disable zoom (ctrl + scroll wheel) in chrome dev tools?

I want to disable zooming in and out chrome dev tools when I hold ctrl and scroll. One way is to completely disable this action from mouse settings for all applications but that I don't want. Can I ...
GorvGoyl's user avatar
  • 237
0 votes
1 answer
498 views

How to remap a key to several characters in AutoHotKey?

I'm making a keyboard layout where nearly every key maps to several characters. I know the usual syntax for remapping a key to a single other key is a::b, but that doesn't seem to work for multiple ...
awe lotta's user avatar
  • 121
0 votes
1 answer
569 views

Remapping Left Shift + up arrow to another key

Hi guys total AutoHotkey newbie here, I was wondering if any experts could help me with a quick script? I would like Left Shift & up arrow key to type the question mark key "?" And Left ...
Matt's user avatar
  • 1
0 votes
1 answer
27 views

Best strategy to block concurrent button presses. Block spacebar while holding CTRL

So a few weeks ago I modified my mechanical keyboard to lube the switches, I broke the Left-ctrl key's contacts on the pcb making it a dummy switch. I have since ran jumpers from the left-ctrl to the ...
Emanuel David's user avatar
0 votes
1 answer
523 views

Browser Keyboard shortcuts not working

I recently switched to a PC ( from a laptop). I use keyboard shortcuts extensively for Chrome (and other browsers), but they're not working on the PC. Specifically, Ctrl+T for new tab and Ctrl+Tab for ...
batchcoding____s's user avatar
1 vote
1 answer
84 views

`alt + ctrl + <anyCharacter>` autohotkey mapping used in a jetbrain IDE goes goes through but then a a popup opens after pressing enter

This quesiton is similar to What is preventing ctrl-alt-m from reaching IntelliJ on Windows 10 . However, ctrl + alt + <anyKey> does go through to the jetbrain IDE, pressing any key after that ...
Sebastian Nielsen's user avatar
0 votes
0 answers
43 views

Multiple cursors at once functionality, just as in the Visual Studio Code but in every Windows application?

Was wondering if this: https://code.visualstudio.com/docs/editor/codebasics can be implemented with WinApi or by DLL calls using something such as https://www.autohotkey.com/docs/commands/DllCall.htm ...
user96769's user avatar
1 vote
1 answer
545 views

Blocking specific keys while a function is running with AutoHotkey

So I made this script with AHK and it works but what I want it to also do, is to make it so while the function is running, it wouldn't be able to be triggered again. So I want to either deactivate the ...
Despina Plyta's user avatar
0 votes
1 answer
418 views

Is there a keyboard shortcut to uncheck, not toggle, a checkbox?

If looking at a webpage checkbox you know whether it needs to be toggled with mouse or spacebar to uncheck. However, with tools that simulate keyboard usage I am not aware of a way to definitively ...
Dan Roberts's user avatar
1 vote
2 answers
229 views

How to turn my screen black and then turn it back on on command?

I need to find a way to make my pc (windows 10) screen turn black, without turning the computer off (or putting it to sleep) and then turn it back on on command. This is because I need t make a ...
Despina Plyta's user avatar
0 votes
0 answers
33 views

How can I reprogram keys of one of my keyboards?

Not sure if this is a question for this forum but: I have a laptop and a connected keyboard (where some keys are not working properly). I would like to edit the keys so that all keys on the left side (...
Clone's user avatar
  • 101
0 votes
1 answer
321 views

Make mouse wheel behave like arrow keys for camera movement in RTS game

I want my mouse wheel to work like the arrow keys on the keyboard, to move the camera in a game the same way I can do it with wheel left/right, which I could bind via the mouse software. But I could ...
El Mero Mero's user avatar
0 votes
1 answer
52 views

ahk script hotkeys losing their original functions

I use some hotkeys in an ahk script but they don't do their original functions if I assign hotkeys. Example: I may have double press esc for alt + f4 closing an application but then esc does not do ...
furkanakkurt1664's user avatar
0 votes
0 answers
67 views

Convert multiple files with AutoHotkey

I'm trying to setup AutoHotkey to automatically convert a selected file to PNGs when pressing a CTRL+ENTER. To do the conversion, I'm using the CLI version of Filestar. I have figured it out how to ...
Niels Bosma's user avatar
3 votes
2 answers
820 views

How to assign multiple hotkeys to the same action?

Here're my current hotkeys: Action Hotkey Short backward jump(10s) J Play / Pause K Short forward jump(10s) L Given this config, I'm losing Space for pausing/playing, so the question is, how to ...
Wenfang Du's user avatar
0 votes
0 answers
457 views

How to create or is there a shortcut to mute the sound of the current window/program?

What I want to do is mute the sound of the current program/window in Windows. How I would normally go about this, is RMB on Sound Icon in taskbar (or through Control Panel -> Sound) -> Open ...
KeyC0de's user avatar
  • 207
3 votes
0 answers
3k views

Remap Bluetooth headset button on Windows 10?

I have Bose QC 35 II and I am trying to get the Multifunction button to mute/unmute calls in MS Teams. For the purpose I will be using AutoHotKey, but in order to do that I need to capture the message ...
checho's user avatar
  • 228

1 2
3
4 5
27