|
Author |
Topic: Access to all Mouse Buttons (Read 296 times) |
|
pitaru
|
Access to all Mouse Buttons
« on: Aug 20th, 2003, 3:45pm » |
|
It would be nice to expand the mousePressed() and mouseReleased() like so: mousePressed(LEFT) - returns true if Left button is pressed mousePressed(RIGHT) - returns true if Right is pressed (.. and same for mouseReleased) Other than the obvious reasons to do so, it would also help students use processing for interaction and usability exercises, without having to dig for the Java syntax.
|
|
|
|
benelek
|
Re: Access to all Mouse Buttons
« Reply #1 on: Aug 21st, 2003, 2:01am » |
|
i'll second that. we need a more straightforward / less java-wiz way of accessing these basic points of interaction.
|
|
|
|
pitaru
|
Re: Access to all Mouse Buttons
« Reply #2 on: Aug 21st, 2003, 3:34pm » |
|
For consistency with java, I'd have it implemented in a different way: void mousePressed(){ if (mouseButton == LEFT){ do this for left click... } if (mouseButton == RIGHT){ do this for left click... } } Or maybe even go as far as using the java term InputEvent instead of mouseButton.
|
« Last Edit: Aug 21st, 2003, 4:09pm by pitaru » |
|
|
|
|
fry
|
Re: Access to all Mouse Buttons
« Reply #3 on: Aug 22nd, 2003, 4:28am » |
|
since the current syntax is a boolean called "mousePressed" and a function called mousePressed, we might also consider "leftMousePressed" and "rightMousePressed", though having separate functions for these gets messy, as it's decidedly un-java like (and not in a good way). the mouseButton== thing might be the way to go. any other ideas?
|
|
|
|
|