Page 1 of 1

remapping keys

Posted: 28 Jul 2021, 01:01
by shadowfire36
Hello all ,

I have been trying to remap my volume keys to my prtscr , scroll lock ,and pause break ..

i cant seem to get them to launch , my keyboard has them locked to fn +,f2,f3,and f4 .... (f2 vol-,f3vol+, f4 mute)
can anyone assist in remapping these to the correct 3 keys.

Code: Select all

#NoEnv
SetWorkingDir %A_ScriptDir%
CoordMode, Mouse, Window
SendMode Input
#SingleInstance Force
SetTitleMatchMode 2
#WinActivateForce
SetControlDelay 1
SetWinDelay 0
SetKeyDelay -1
SetMouseDelay -1
SetBatchLines -1


F4::
Mute:
Send, {Volume_Mute}
Return

F2::
Vol_Down:
Send, {Volume_Down}
Return

F3::
Vol_Up:
Send, {Volume_Up}
Return
[Mod edit: [code][/code] tags added.]

Re: remapping keys

Posted: 28 Jul 2021, 05:20
by boiler
Try the script below. I left your extra labels (Mute, VolDown, VolUp) in place, which I assume you call from elsewhere in the script. Otherwise, they're not needed and you could make them remaps like the others instead of using Send. Remaps would generally be better. One reason is they will allow modifier keys to be carried through as if you used {Blind} with Send.

Code: Select all

Volume_Mute::PrintScreen

Volume_Down::ScrollLock

Volume_Up::Pause

F4::
Mute:
Send, {Volume_Mute}
Return

F2::
VolDown:
Send, {Volume_Down}
Return

F3::
VolUp:
Send, {Volume_Up}
Return

Re: remapping keys

Posted: 29 Jul 2021, 00:21
by shadowfire36
It doesnt give the volume controls to those keys after running the script

Re: remapping keys

Posted: 29 Jul 2021, 06:41
by boiler
For me, the function keys acting volume down and volume mute worked. The volume up had a problem because I see now Pause can't be used as a key name in a remap because it's also a command name. They work for me when I change the line Volume_Up::Pause to Volume_Up::vk13.

Reference:
Remapping Keys 'Remarks' section wrote:Pause and Break as destination key names (since they match the names of commands). [v1.1.32+]: vk13 or the corresponding scan code can be used instead.