Why aren't MOUSE_MOVE events dispatched when the middle mouse button is pressed?
I am listening for MOUSE_MOVE events.
They are sent and received only with a penalty if the middle mouse button is not held down. I don't get any more MOUSE_MOVE events until the middle button is released.
Is this a Flash issue, or something to do with my specific mouse / computer configuration (bluetooth Mighty Mouse on Lion)?
Are there any known workarounds?
Here is a sample project to demonstrate the problem.
Left-clicking and dragging mouse traces move events, but middle-clicking shows only the middle mouse and middle mouse up.
import flash.events.MouseEvent;
this.stage.addEventListener(MouseEvent.MIDDLE_MOUSE_DOWN, onMiddleMouseDown);
this.stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
function onMiddleMouseDown(e:MouseEvent):void {
trace("middle down");
this.stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
this.stage.addEventListener(MouseEvent.MIDDLE_MOUSE_UP, onMiddleMouseUp);
}
function onMouseMove(e:MouseEvent):void {
trace("mouse move");
}
function onMiddleMouseUp(e:MouseEvent):void {
trace("middle up");
this.stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
this.stage.removeEventListener(MouseEvent.MIDDLE_MOUSE_UP, onMiddleMouseUp);
}
function onMouseDown(e:MouseEvent):void {
trace("down");
this.stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
this.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
function onMouseUp(e:MouseEvent):void {
trace("up");
this.stage.removeEventListener(MouseEvent.MOUSE_MOVE, onMouseMove);
this.stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
UPDATE:
It looks like the position of the mouse (the mouseX and mouseY properties) is not updated when the middle button is held down. I would still like to know why, or if there is a workaround for this.
source to share
It looks like it was a bug in Flash Player for Mac.
Adobe fixed it:
https://bugbase.adobe.com/index.cfm?event=bug&id=3674152
source to share