transform double click on Z to double click on mouse
When I click 2 times on the touch "z" (keycode 90) on my keyboard, my item is removed.
I'd like to change it and when we click 2 times with the mouse the item is removed but I can't figure out how to do it... if mouseDown = true ? it does'nt seem to work...
timer=new Timer(500, 1);
stageRef.addEventListener(KeyboardEvent.KEY_UP, removeDraggedItem);
private function removeDraggedItem(e:KeyboardEvent)
{ if(timer.running==true)
{ if(e.keyCode==90)
{ stageRef.removeEventListener(MouseEvent.MOUSE_MOVE, dragItem);
stageRef.removeEventListener(Event.ENTER_FRAME, itemHitTest);
draggedItem.removeEventListener(MouseEvent.MOUSE_DOWN, itemClick);
stageRef.removeChild(draggedItem); toolbar.useText.text = "";
if (stageRef.contains(this)) stageRef.removeChild(this);
Mouse.show();
Engine.playerControl = true; }
} else if(e.keyCode==90) { timer.start(); }
}
I've tried to change (e.keyCode==90) by (e.buttonDown). No errors but nothings is happening when I double click...any idea why ?
