Would like hotkeys to only work when external keyboard is plugged in

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
loopernow
Posts: 27
Joined: 17 Mar 2019, 14:18

Would like hotkeys to only work when external keyboard is plugged in

Post by loopernow » 10 Sep 2022, 11:02

I have a laptop that I sometimes use with an external keyboard. The ordering of the modifier keys on the external keyboard is not standard, so I use an Autohotkey script to swap the Alt and Windows keys.

I'd like the key swap to function when the external keyboard is plugged in, and stop functioning when the external keyboard is not plugged in. Is this possible?

skyth540
Posts: 72
Joined: 24 Aug 2022, 10:07

Re: Would like hotkeys to only work when external keyboard is plugged in

Post by skyth540 » 29 Sep 2022, 11:20

sounds like you want to have ahk be smart enough to tell which keyboard is saying what

https://www.youtube.com/watch?v=Arn8ExQ2Gjg

Lepes
Posts: 141
Joined: 06 May 2021, 07:32
Location: Spain

Re: Would like hotkeys to only work when external keyboard is plugged in

Post by Lepes » 29 Sep 2022, 20:24

Recently appears a thread that could help: viewtopic.php?p=484546#p484546

If you plug your external keyboard, you automatically run a script (the one that swaps the keys).
If you unplug your external keyboard, you close the swapping script.

Please note that if you run your script that swaps keys, the keys will be swapped on both keyboards at the same time, because windows don't identify wich key came from each keyboard.

Post Reply

Return to “Ask for Help (v1)”