This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
nitrogenfingers's profile picture

Mouse Event Issue

Started by nitrogenfingers, 06 August 2016 - 03:37 AM
nitrogenfingers #1
Posted 06 August 2016 - 05:37 AM
I've come across an issue with capturing mouse events, but I'm not sure if it's a bug, intended behaviour or an issue with my software.

You can observe my issue with this program: http://pastebin.com/mFKhPS5u

There you can see that mouse_up events do not correctly report when two separate mouse buttons are pressed simultaneously, as the key events do. You can observe how I am capturing these events in the run function at line 147.

Is this a known issue or have I done something wrong?
Bomb Bloke #2
Posted 06 August 2016 - 03:12 PM
Checking it myself with this line in the Lua console:

while true do print(os.pullEvent()) end

… I'm seeing that if multiple mouse buttons are held down at once, only the last button pressed will generate a mouse_up event on release.

This is under CC 1.79. 1.80 is currently in beta, but what with one thing and another, I haven't gotten around to installing that yet. If the bug also exists there then it should go to the tracker (as I can't see an existing report).

Edit:

By the way;

string.char(149) == "\149"
Edited on 08 August 2016 - 02:05 AM