dlangui.core.events
This module contains dlangui event types declarations.Synopsis:
import dlangui.core.events;
License:
Boost License 1.0
Authors:
Vadim Lopatin, coolreader.org@gmail.com
- struct Accelerator;
- keyboard accelerator (key + modifiers)
- class Action;
- UI action
- @property string stringParam();
- additional string parameter
- @property long longParam();
- additional long parameter
- @property Object objectParam();
- additional custom (Object) parameter
- this(Action a);
- deep copy constructor
- @property Action clone();
- deep copy
- this(int id);
- create action only with ID
- this(int id, uint keyCode, uint keyFlags = 0);
- action with accelerator, w/o label
- this(int id, dstring label, string iconResourceId = null, uint keyCode = 0, uint keyFlags = 0);
- action with label, icon, and accelerator
- @property Accelerator[] accelerators();
- returs array of accelerators
- @property dstring acceleratorText();
- returns text description for first accelerator of action; null if no accelerators
- bool checkAccelerator(uint keyCode, uint keyFlags);
- returns true if accelerator matches provided key code and flags
- enum MouseAction: ubyte;
- mouse action
- Cancel
- button down handling is cancelled
- ButtonDown
- button is down
- ButtonUp
- button is up
- Move
- mouse pointer is moving
- FocusIn
- pointer is back inside widget while button is down after FocusOut
- FocusOut
- pointer moved outside of widget while button was down (if handler returns true, Move events will be sent even while pointer is outside widget)
- Wheel
- scroll wheel movement
- Leave
- pointer left widget which has before processed Move message, while button was not down
- enum MouseFlag: ushort;
- mouse flag bits
- enum MouseButton: ubyte;
- mouse button
- struct ButtonDetails;
- mouse button state details
- long _downTs;
- Clock.currStdTime() for down event of this button (0 if button is up).
- long _upTs;
- Clock.currStdTime() for up event of this button (0 if button is still down).
- short _downX;
- x coordinates of down event
- short _downY;
- y coordinates of down event
- ushort _downFlags;
- mouse button flags when down event occured
- void down(short x, short y, ushort flags);
- update for button down
- void up(short x, short y, ushort flags);
- update for button up
- @property int downDuration();
- returns button down state duration in hnsecs (1/10000 of second).
- class MouseEvent;
- mouse event
- @property MouseButton button();
- button which caused ButtonUp or ButtonDown action
- @property MouseAction action();
- action
- @property ushort flags();
- flags (buttons and keys state)
- @property short wheelDelta();
- delta for Wheel event
- @property short x();
- x coordinate of mouse pointer (relative to window client area)
- @property short y();
- y coordinate of mouse pointer (relative to window client area)
- @property Widget trackingWidget();
- get event tracking widget to override
- void track(Widget w);
- override mouse tracking widget
- enum KeyAction: uint;
- KeyEvent action
- enum KeyFlag: uint;
- KeyEvent flags
- enum KeyCode: uint;
- Key code constants
- class KeyEvent;
- keyboard event
- @property KeyAction action();
- key action (KeyDown, KeyUp, Text, Repeat)
- @property uint keyCode();
- key code
- @property uint flags();
- flags (shift, ctrl, alt...)
- @property dstring text();
- entered text, for Text action
- this(KeyAction action, uint keyCode, uint flags, dstring text = null);
- create key event
- enum ScrollAction: ubyte;
- scroll bar / slider action
- class ScrollEvent;
- slider/scrollbar event
- string keyName(uint keyCode);
- converts key code to key name