I just posted a bug-report at the Firefox bug-tracker.
The problem is that if you create an AHK script that has a hotkey that uses the Windows key to Send text, it works everywhere as expected, unless you compile the script, in which case, it works everywhere except Firefox. It's a strange, very specific scenario.
There's a a thread here that seems like it's probably related, but that seems to be fixed, so unless it's a regression, the two issues might be caused by a common, underlying issue.
Firefox blocks Win-key macros from compile AHK scripts
Firefox blocks Win-key macros from compile AHK scripts
Last edited by joedf on 08 Oct 2019, 07:11, edited 4 times in total.
Reason: Fix link
Reason: Fix link
Re: Firefox blocks Win-key macros from compile AHK scripts
Hmm interesting...
I'll give this a try later today.
I'll give this a try later today.
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Firefox blocks Win-key macros from compile AHK scripts
I have reproduced your case...
So it seems the hotkey is still detected, but firefox doesnt get the "memo". If we use a msgbox, it shows the hotkey is still being detected...
If we use a sendinput instead, the desired behaviour is achieved.
So it seems the hotkey is still detected, but firefox doesnt get the "memo". If we use a msgbox, it shows the hotkey is still being detected...
If we use a sendinput instead, the desired behaviour is achieved.
Code: Select all
; ⊞Win+C should paste "foobar"
#c::sendInput foobar
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Firefox blocks Win-key macros from compile AHK scripts
It works just fine on this Windows 7 computer.
Re: Firefox blocks Win-key macros from compile AHK scripts
It works for me also.
Tested on:
Windows 10 - 1903 (Build 18362.418)
Firefox 69.0.2 (64-Bit)
AutoHotkey 1.1.30.03 (compiled as 64-Bit Unicode)
Tested on:
Windows 10 - 1903 (Build 18362.418)
Firefox 69.0.2 (64-Bit)
AutoHotkey 1.1.30.03 (compiled as 64-Bit Unicode)
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
Re: Firefox blocks Win-key macros from compile AHK scripts
For me works compiled script in firefox 69.0.2 (64-bit), Win10 LTSC, ahk 64 bit 1.1.31.
Code: Select all
#c::send foobar
Re: Firefox blocks Win-key macros from compile AHK scripts
I just tried again today.... and it worked either way... hmmm
Test System Info:
Test System Info:
Spoiler
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: Firefox blocks Win-key macros from compile AHK scripts
Hmm, indeed. I tried it with sendinput, but it didn't work. Then I reverted it to send and added a msgbox call to see the hotkey just before the send command, and now it. Now I'm wondering if it's a race-condition, some sort of timing issue. I'm not sure why this only affects Firefox though.
I just tried it in a fresh VM and got the same results on my main system:
- All versions work in Windows Explorer, Notepad, Chrome, everywhere
- All version of raw script work in Firefox
- Compiled script with msgbox before send works in Firefox
- Compiled script without msgbox (with send or sendinput) does NOT work in Firefox
- Replacing msgbox with tooltip makes it stop working in Firefox again
- Adding a sleep delay doesn't make it work, only msgbox seems to work
Also, I don't use the compiler that comes with AutoHotkey, I use the old compiler-wrapper (with the joystick icon) which provides a lot more control over the resulting executable. Passing the new (Unicode) .bin file to the old compiler also works. (I don't know why Unicode emojis are so huge on this message board. )
Who is online
Users browsing this forum: No registered users and 33 guests