Hello again,
I want to control the behaviour of an running script for some seconds via the right mouse button. Hotstring() should call a function, when possible with parameters. I tried different RButton-"syntax" without success. I'm aware of option X (Execute) for calling a function.
Any hints are highly appreciated!
Many thanks and greetings
hotkeyguy
Hotstring() via RButton only calling function (with parameters?) Topic is solved
Re: Hotstring() via RButton only calling function (with parameters?)
Be specific. Exactly what will you do as the user? Exactly what will the script do in response? Explain, step by step. Include an example.
Re: Hotstring() via RButton only calling function (with parameters?)
1. Using RButton as hotstring directly, calling a function, works:
2. HotString()-function, with hotstring "rb " works - but I want to use the right mouse button (RButton) as trigger, no text. Due to my requirement, I must be able to switch the hotstring on and off, therefore the use of the HotString()-function.
3. Is it possible to pass parameters to HotFct()?
Code: Select all
RButton::
HotFct()
return
HotFct()
{
MsgBox, , Hotstring, Triggered!
}
Code: Select all
HotString( ":X:rb", "HotFct", "On" )
return
HotFct()
{
MsgBox, , Hotstring, Triggered!
}
Re: Hotstring() via RButton only calling function (with parameters?) Topic is solved
Hotstrings are for text strings, not buttons. You can add a Hotkey command to your first script. It is analogous to Hotstring() but for hotkeys.
Or:
Or:
Code: Select all
Gosub, F3
F3::
Hotkey, RButton, RB1, On
SoundBeep, 1500
Return
F4::
Hotkey, RButton, RB2, On
SoundBeep, 1200
Return
F5::
Hotkey, RButton, Off
SoundBeep, 900
Return
RB1:
HotFct("Definitely triggered!")
Return
RB2:
HotFct("Really triggered!")
Return
HotFct(str)
{
MsgBox, 64, Hotstring, %str%
}
Code: Select all
F3::
F4::
fn := Func("HotFct").Bind(A_ThisHotkey)
Hotkey, RButton, %fn%, On
SoundBeep, 1500
Return
F5::
Hotkey, RButton, Off
SoundBeep, 1000
Return
HotFct(str)
{
MsgBox, 64, Hotstring, %str%
}
Code: Select all
F3::
F4::
str := A_ThisHotkey, on := True
SoundBeep, 1500
Return
F5::
on := False
SoundBeep, 1000
Return
#If on
RButton::HotFct(str)
#If
HotFct(str)
{
MsgBox, 64, Hotstring, %str%
}
Re: Hotstring() via RButton only calling function (with parameters?)
Many thanks mikeyww for rerailing, I was confused Hotstring vs. Hotkey!
Who is online
Users browsing this forum: Google [Bot], ReyAHK and 199 guests