Page 1 of 1

Ctrl PAUSE doesn't work as a hotkey

Posted: 02 Aug 2017, 18:49
by Voideka
I made a little push-to-talk script for myself, so that when I press PAUSE my mic unmutes, and when I release the mic goes back to muted. I decided to put a wildcard in front (*PAUSE), so that if I'm holding shift in a game it will still allow me to talk, but it didn't seem to work with control. I then made the hotkey ^PAUSE to test, and it didn't work either. I could swear I was able to use Ctrl and PAUSE in a shortcut before, so I restarted my computer and got it to work, before it stopped working again after I hit Ctrl+PAUSE in Notepad++ which prints the ASCII control code ETX (which I think is just something N++ does). I restarted again and that time it wouldn't work from boot. I disabled my AV and exited as many processes as I could think of, to no avail. I tried googling around but I haven't yet found an explanation. !PAUSE, +PAUSE work fine, but any combination involving Ctrl does not.

I'm running Win10 with AHK version 1.1.26.01.

Re: Ctrl PAUSE doesn't work as a hotkey

Posted: 03 Aug 2017, 02:04
by Noesis
What's happening is Ctrl + Pause is generating a CtrlBreak key press, as per AHK's help https://autohotkey.com/docs/KeyList.htm. Look for the "Break" key in the key listing.

Re: Ctrl PAUSE doesn't work as a hotkey

Posted: 03 Aug 2017, 20:12
by Voideka
Well that worked, thanks. However, I just want to double check: does that also explain the erratic behavior? As mentioned, it would sometimes register ^PAUSE normally, which is what made everything confusing.

Re: Ctrl PAUSE doesn't work as a hotkey

Posted: 04 Aug 2017, 07:51
by Noesis
IMO the only thing that could be considered a bug about this is that it apparently worked at all with ^Pause. Problem with this is that it is also erratic, and essentially it shouldn't work. Bottom line is unless you find that using ctrlbreak is also erratic, I would think it's not really bugged, more in the realm of unexpected/undefined behavior occurring, due to the script's code (i.e. the script has a bug rather than ahk having one). Just my opinion of-course.

It's also possible the actual keyboard, or it's driver has something to do with it, as my understanding is some keyboards may have a separate break key or generate this key on different key combos, so ctrl pause may produce an actual ctrl pause instead, depending on this and other factors (Including the OS being used). Perhaps in you're case sometimes both messages got sent or something. So no it doesn't really explain the erratic behavior, but there are reasons as to how it could possibly happen, especially when one considers the OS is also partly responsible.