Page 1 of 1

Having Problems allocating media buttons [Beginner]

Posted: 27 Nov 2022, 01:34
by Anfly
Let me explain the problem as quickly as possible. I cannot assign media button to hotkeys. This is my current script :

Code: Select all

MusicSave:
Gui,2:Submit,Nohide
GuiControlGet,PrevHotkey1,2:,PrevHotkey
GuiControlGet,NextHotkey1,2:,NextHotkey
GuiControlGet,VolupHotkey1,2:,VolupHotkey
GuiControlGet,VoldownHotkey1,2:,VoldownHotkey
GuiControlGet,MuteHotkey1,2:,MuteHotkey
GuiControlGet,PauseHotkey1,2:,PauseHotkey
if(PrevHotkey1 != PrevHotkey){
    Hotkey, %Prev_Hotkey%, PrevFunction, off  
    Prev_Hotkey:=PrevHotkey1 
    Hotkey, %Prev_Hotkey%, PrevFunction, on
}
if(NextHotkey1!=NextHotkey){
    Hotkey, %Next_Hotkey%, NextFunction, off  
    Next_Hotkey:=NextHotkey1 
    Hotkey, %Next_Hotkey%, NextFunction, on
}
if(VolupHotkey1!=VolupHotkey){
    Hotkey, %Up_Hotkey%, UpFunction, off  
    Up_Hotkey:=VolupHotkey1
    Hotkey, %Up_Hotkey%, UpFunction, on
}
if(VoldownHotkey1!=VoldownHotkey){
    Hotkey, %Down_Hotkey%, DownFunction, off
    Down_Hotkey:=VoldownHotkey1
    Hotkey, %Down_Hotkey%, DownFunction, on
}
if(MuteHotkey1!=MuteHotkey){
    Hotkey, %Mute_Hotkey%, MuteFunction, off
    Mute_Hotkey:=MuteHotkey1
    Hotkey, %Mute_Hotkey%, MuteFunction, on
}
if(PauseHotkey1!=PauseHotkey){
    Hotkey, %Pauseh_Hotkey%, PausehFunction, off
    Pauseh_Hotkey:=PauseHotkey1 
    Hotkey, %Pauseh_Hotkey%, PausehFunction, on
}

Reload
Return

PrevFunction:
Media_Prev
Return
NextFunction:
Media_Next
Return
UpFunction:
Volume_Up
Return
DownFunction:
Volume_Down
Return
MuteFunction:
Media_Play_Pause
Return
PausehFunction:
Media_Play_Pause
Return
It keeps giving me the problem "Media_Prev does not contain a recognized action"
Thank you for the help!

Re: Having Problems allocating media buttons [Beginner]

Posted: 27 Nov 2022, 04:52
by Xtra
This might be what you intended:

Code: Select all

PrevFunction:
Send, {Media_Prev}
Return

Re: Having Problems allocating media buttons [Beginner]

Posted: 27 Nov 2022, 16:22
by Anfly
Thanks, it works :D