function mouseEventHandler(event) {
if (event.type == "mousedown") {
// Mouse Down
} else if (event.type == "mousemove") {
// Mouse Move
} else if (event.type == "mouseup") {
// Mouse Up
}
}
Versuch es mit dem mouseEventHandlerfunction mouseEventHandler(event) { if (event.type == "mousedown") { // Mouse Down } else if (event.type == "mousemove") { // Mouse Move } else if (event.type == "mouseup") { // Mouse Up } }
function onMouseEvent(eventType, mousePosition)
if eventType == eEvtMouseWheelUp or eventType == eEvtMouseWheelDown then
-- mouse wheel was activated, do something
end
end
registerEventHandler("mouseEvent", "onMouseEvent", {eEvtMouseMove, eEvtMouseLeftButtonDoubleClick, eEvtMouseLeftButtonDown, eEvtMouseLeftButtonUp, eEvtMouseLeftButtonHold, eEvtMouseLeftButtonHolding, eEvtMouseRightButtonDoubleClick, eEvtMouseRightButtonDown, eEvtMouseRightButtonUp, eEvtMouseMiddleButtonDown, eEvtMouseMiddleButtonUp, eEvtMouseWheelUp, eEvtMouseWheelDown})
function onMouseEvent(eventType, mousePosition)
if eventType == eEvtMouseMove then
-- do something on mouse move
elseif eventType == eEvtMouseLeftButtonDown then
-- do something on left mouse button down
elseif eventType == eEvtMouseLeftButtonUp then
-- do something on left mouse button up
end
end
registerEventHandler("mouseEvent", "onMouseEvent", {eEvtMouseMove, eEvtMouseLeftButtonDown, eEvtMouseLeftButtonUp})