ID:2824959
 
Not a bug
BYOND Version:514
Operating System:Windows 10 Home 64-bit
Web Browser:Chrome 105.0.0.0
Applies to:Dream Daemon
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Descriptive Problem Summary:
According to http://www.byond.com/docs/ref/#/DM/mouse and rational expectation one expects that MouseDown will send only the mouse key that just changed in params.
However, it instead sends ALL keys that are currently held even if the key was not lifted or lowered.

Numbered Steps to Reproduce Problem:
1. Hold right click
2. MouseDown for right click is called
3. Hold left click
4. MouseDown for right AND left click is called
5. Release right click
6. MouseUp for right AND left click is called
7. Release left click
8. MouseUp for left click is called

Result:
MouseDown right: 2
MouseUp right: 1
MouseDown left: 1
MouseUp left: 2

Code Snippet (if applicable) to Reproduce Problem:
https://github.com/TiviPlus/basic-test-project/tree/ mouse_downs

Expected Results:
1 params entry for each buttons MouseUp per MouseDown
Actual Results:
Unexpected multiple param entries resulting in buggy behavior

Does the problem occur:
Every time? Or how often? Yes
In other games? Yes
In other user accounts? Yes
On other computers? Yes

When does the problem NOT occur?
100% reproduction rate

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Workarounds:
Not tested, but manually tracking what keys are held for each player serverside and removing them from params would likely fix the MouseDown issue, no idea for the MouseUp issue
Not a bug. There is a mouse param that was added in 513 that tells you which key caused the action.
Lummox JR resolved issue (Not a bug)
The "button" param is the one you're looking for.
@Lummox can this behavior be added to the documentation please
It was.
Not in http://www.byond.com/docs/ref/#/DM/mouse, which claims to have the list of params in params2list ("It may contain any of the following properties,")
Looks like I'd just forgotten to update the online ref.