diff --git a/build/shared/libraries/howto.txt b/build/shared/libraries/howto.txt index 063040374..257e76f3e 100644 --- a/build/shared/libraries/howto.txt +++ b/build/shared/libraries/howto.txt @@ -171,8 +171,8 @@ legitimate drawing is taking place, and the mouse/key events happen just before draw() events are called, they're queued up by the host applet until it's safe to draw. -For this reason, you should use registerMouse() and mouseEvent() (and -same for the keys) to handle your events, rather than your class +For this reason, you should use registerMouseEvent() and mouseEvent() +(and same for the keys) to handle your events, rather than your class implementing MouseListener. For instance, to figure out what the mouse event is throwing back at you, this would be an example handler: @@ -194,7 +194,7 @@ public void mouseEvent(MouseEvent event) { // do something for mouse dragged break; case MouseEvent.MOUSE_MOVED: - // umm + // umm... break; } } @@ -202,6 +202,8 @@ public void mouseEvent(MouseEvent event) { More on mouse handling can be found in Sun's Java documentation: http://java.sun.com/j2se/1.4.2/docs/api/java/awt/event/MouseEvent.html which also covers things like modifiers (shift-click) and whatnot. +Also check out the code for PApplet to see how ctrl-click is handled +on Mac OS X so that it properly registers as a right-click. //////////////////////////////////////////////////////////////