The OpenD Programming Language

MouseEventBase

Contains shared properties for various mouse events;

More...

Members

Aliases

modifierState
alias modifierState = state

for consistent names with key event.

Functions

isMouseWheel
bool isMouseWheel()

Mouse wheel movement sends down/up/click events just like other buttons clicking. This method is to help you filter that out.

Variables

altKey
bool altKey;

Indicates the current state of the given keyboard modifier keys.

button
int button;

See: MouseEvent.button

buttonLinear
int buttonLinear;

See: MouseEvent.buttonLinear

clientX
int clientX;
clientY
int clientY;

The mouse event location relative to the target widget

ctrlKey
bool ctrlKey;
shiftKey
bool shiftKey;

Indicates the current state of the given keyboard modifier keys.

state
int state;
viewportX
int viewportX;
viewportY
int viewportY;

The mouse event location relative to the window origin

Inherited Members

From Event

getPropertiesList
void getPropertiesList(void delegate(string name) sink)
getPropertyAsString
void getPropertyAsString(string name, void delegate(string name, scope const(char)[] value, bool valueIsJson) sink)
setPropertyFromString
SetPropertyResult setPropertyFromString(string name, const(char)[] str, bool strIsJson)

Implementations for the ReflectableProperties interface/

propagates
bool propagates()

Events should generally follow the propagation model, but there's some exceptions to that rule. If so, they should override this to return false. In that case, only bubbling event handlers on the target itself and capturing event handlers on the containing window will be called. (That is, dispatch will call sendDirectly instead of doing the normal capture -> target -> bubble process.)

cancelable
bool cancelable()

hints as to whether preventDefault will actually do anything. not entirely reliable.

Register
mixintemplate Register()

You can mix this into child class to register some boilerplate. It includes the EventString member, a constructor, and implementations of the dynamic get data interfaces.

source
Widget source;
target
alias target = source
srcElement
alias srcElement = source

This is the widget that emitted the event.

relatedTarget
Widget relatedTarget;

Note: likely to be deprecated at some point.

preventDefault
void preventDefault()

Prevents the default event handler (if there is one) from being called

stopPropagation
void stopPropagation()

Stops the event propagation immediately.

adjustScrolling
void adjustScrolling()
adjustClientCoordinates
void adjustClientCoordinates(int deltaX, int deltaY)

This is an internal implementation detail you should not use. It would be private if the language allowed it and it may be removed without notice.

sendDirectly
void sendDirectly()

this sends it only to the target. If you want propagation, use dispatch() instead.

dispatch
void dispatch()

this dispatches the element using the capture -> target -> bubble process

intValue
int intValue [@property getter]
stringValue
string stringValue [@property getter]

Detailed Description

You can construct these yourself, but generally the system will send them to you and there's little need to emit your own.

Meta

History

Added May 2, 2021. Previously, its properties were members of the Event base class.