Page 1 of 1
AHK will not override Windows default hotkeys
Posted: 13 Jan 2019, 16:18
by bkrstmuse
I'm trying to do something simple in Windows 10: hotkeys to reprogram buttons on my remote.
I want the "Media_Play_Pause" button to send {space} and the "Browser_Search" button to send "F" (used for full screen). The hotkeys run fine but they don't override the default Windows actions.
Here's my script:
;pause/play button = space
vkB3::{space}
;Search button = full screen
*vkAA::f
And here's what it's doing:
Play/Pause:
B3 122 h d 12.81 Media_Play_Pause
20 039 i d 0.00 Space
20 039 i u 0.00 Space
B3 122 a u 0.20 Media_Play_Pause
Search:
AA 165 h d 2.19 Browser_Search
46 021 i d 0.00 f
5C 05C a d 0.00 RWin
53 01F a d 0.00 s
53 01F a u 0.00 s
5C 05C a u 0.00 RWin
AA 165 h u 0.22 Browser_Search Cortana
46 021 i u 0.00 f
Any way to fix this?
Re: AHK will not override Windows default hotkeys
Posted: 13 Jan 2019, 16:48
by rommmcek
Syntax!
Code: Select all
;pause/play button = space
vkB3::Send, {space}
;Search button = full screen
*vkAA::Send, f
Re: AHK will not override Windows default hotkeys
Posted: 13 Jan 2019, 18:03
by bkrstmuse
Tried that. Still same problem.
Re: AHK will not override Windows default hotkeys
Posted: 13 Jan 2019, 18:37
by rommmcek
This is very strange!
Would you mind to test
this code and report result?
Btw.: I experience no problems!
Re: AHK will not override Windows default hotkeys
Posted: 13 Jan 2019, 19:51
by bkrstmuse
both LWin & Right:: and #Right:: produce the same result:
5B 15B d 4.77 LWin
27 14D h d 0.22 Right
11 01D i d 0.00 Control
11 01D i u 0.00 Control
5B 15B i u 0.00 LWin
23 14F i d 0.00 End
23 14F i u 0.00 End
11 01D i d 0.00 Control
5B 15B i d 0.00 LWin
11 01D i u 0.00 Control
27 14D s u 0.16 Right
5B 15B u 0.06 LWin
A2 01D i d 0.00 LControl
A2 01D i u 0.00 LControl
I also tried this and it seems to work fine and override the windows-d command fine:
#d::
send, d
return
It only seems to create a problem when AHK is trying to take over multimedia keys.
Re: AHK will not override Windows default hotkeys
Posted: 14 Jan 2019, 01:00
by gregster
bkrstmuse wrote: ↑13 Jan 2019, 19:51
It only seems to create a problem when AHK is trying to take over multimedia keys.
Strange, I have disabled/changed the functions of my multimediakeys without glitch for years now.
WhicH AHK version are you running?
Re: AHK will not override Windows default hotkeys
Posted: 14 Jan 2019, 02:05
by bkrstmuse
v1.1.30.01.
Re: AHK will not override Windows default hotkeys
Posted: 14 Jan 2019, 03:53
by rommmcek
bkrstmuse wrote:both LWin & Right:: and #Right:: produce the same result:
Did
Win + Right keys in any case trigger Start menu?
P.s.: To override multimedia keys you might try:
Code: Select all
;pause/play button = space
vkB3::Send % " "
;Search button = full screen
*vkAA::Send % "f"
P.p.s.: What about testing it with a different keyboard (hardware)?, besides when having unexpected results I tend to test running script as administrator.
Re: AHK will not override Windows default hotkeys
Posted: 14 Jan 2019, 11:18
by bkrstmuse
rommmcek wrote: ↑14 Jan 2019, 03:53
bkrstmuse wrote:both LWin & Right:: and #Right:: produce the same result:
Did
Win + Right keys in any case trigger Start menu?
P.s.: To override multimedia keys you might try:
Code: Select all
;pause/play button = space
vkB3::Send % " "
;Search button = full screen
*vkAA::Send % "f"
P.p.s.: What about testing it with a different keyboard (hardware)?, besides when having unexpected results I tend to test running script as administrator.
Wow, running as administrator did the trick! Thanks!
Anyway, here are the answers to your questions:
1. Win + Right keys did not trigger anything, and it seems to have overridden the default "snap to right" Windows function.
2. I tried your new code and it still does the same thing.
3. I tried using the media buttons on different hardware (logitech k270) and for some reason those buttons don't trigger AHK. The keylogger doesn't detect it at all. Weird.
Re: AHK will not override Windows default hotkeys
Posted: 14 Jan 2019, 12:04
by rommmcek
Thanks for the feedback!
Yeah, modern Windows (Win8+) require sometimes admin. Probably depending on security settings, but I don't know much about that.
For other hardware (keyboard), try at least to log off or even restart OS, if you didn't do that already.