FAQ
Cover
\
Build
\
Source
\
Bugs
\
Reference
\
Libraries
\
Tools
The bugs database has moved
here
.
Bug 154 : mouseX jumps to a strange number when moving off the left side of the window on os x
Last modified: 2005-09-18 12:31
P
roject:
processing
trash
Version:
unspecified
Co
m
ponent:
android
book
core
libraries
pde
reference
tools
web
Status:
RESOLVED
Resolution:
WONTFIX -
Pr
i
ority:
P5
Severity:
normal
Platform
All
O
S:
All
Windows
Mac OS
Linux
Other
Reporter:
Shawn Van Every
Assigned To:
fry
Attachment
Type
Created
Size
Actions
Description
: Opened: 2005-09-18 10:54
Beta 91 on MacOS X 10.4.2
Here is code to illustrate:
// Teleporting MouseX off the left side of the screen
int x, y, h, w;
void setup()
{
size(500,500);
framerate(10);
}
void draw()
{
background(0,0,0);
x = mouseX;
y = mouseY;
h = mouseX;
w = mouseY;
if (x <= 0)
{
x = 10;
}
else if (x >= width)
{
x = width - 10;
}
if (y <= 0)
{
y = 10;
}
else if (y >= height)
{
y = height - 10;
}
rect(x,y,10,10);
println("x = " + mouseX + " y = " + mouseY);
}
Additional Comment
#1 From fry 2005-09-18 12:31
this unfortunately appears to be an issue with how apple's implemented the mouse handling
in their java vm. this came up before and it seems to be specific to their implementation of
the event handling in java 1.4 versus 1.3.
of course, there's lots of weirdness for how components are handled, but since we're not
seeing this on sun's own implementation, we have to assume it's apple's bug.