The inputAction command doesn't detect the secondary mouse button. My joystick also has a secondary mouse button which isn't detected by the command. However, they do detect a RMB hold.
Description
Details
- Legacy ID
- 2597464152
- Severity
- None
- Resolution
- Open
- Reproducibility
- Always
- Operating System
- Windows 7
- Category
- Scripting
- Bind right mouse to "Use Action 1" in "Custom controls", or test the following:
(input actions bound to RMB click: "optics", "opticsTemp", "menuBack")
- Run code in console:
hint "";
- spawn {waitUntil {inputAction "user1" != 0}; hint "detected"}
- press the button ingame
Related Objects
Event Timeline
The RMB mouse button works with inputAction just fine:
oneachframe {hintsilent str [inputAction "holdbreath"]}
However if bound to user action, inputAction fails to detect mouse button input:
- bind sec mouse button to User Action 1
- execute
oneachframe {hintsilent str [inputAction "user1"]}
- no effect
Edited the title
"holdbreath" is detected for me, but only because its bound to RMB hold. Even when using your code, binding RMB click to holdBreath, or any other action is still undetected.
That's true, I just tested. So the issue is with mouse button hold.
- open User Action 1 bindings
- press and hold RMB to add mouse button binding
- execute
oneachframe {hintsilent str [inputAction "user1"]}
- it Works
do the same as above but add normal button press instead of hold
it doesnt work.
Not sure if this is related, but I've noticed when binding RMB to a control it detects it as Hold Sec. Mouse Button for a half-second then switching to normal Sec. Mouse Button. Issue does not occur when binding Sec. Mouse button with a modifier (Ctrl, Shift, Alt).
Tested on stable branch with two different mice and no addons.
running the following code
`
systemChat str (inputAction 'optics'); systemChat str (inputAction 'opticsTemp'); systemChat str (inputAction 'opticsMode');
`
will always print 0 for all 3, when the bind is RMB (right mouse button).
However, when binding to keyboard, like "H", inputAction works and prints 1
Looks very much like a "won't fix"
always handling mouse clicks as mouse hold's was done intentionally because that makes more sense to the average player