Module dcanvas.core.events
Dlangui event types declarations.
Event types: MouseEvent, KeyEvent, ScrollEvent.
Action and Accelerator.
Functions
| Name | Description |
|---|---|
actionIdToName(id)
|
converts id to name for actions registered by registerActionEnum, returns null if not found |
actionNameToId(name)
|
converts action name id for for actions registered by registerActionEnum, returns 0 if not found |
clearActionAcceleratorsMap()
|
clear global action accelerators map |
findActionAccelerators(actionId)
|
lookup accelerators override for action by id |
findActionAccelerators(actionName)
|
lookup accelerators override for action by name (e.g. "EditorActions.ToggleLineComment") |
keyName(keyCode)
|
Converts KeyCode enum value to human readable key name |
matchKeyFlags(eventFlags, requestedFlags)
|
Match key flags |
mouseButtonToFlag(btn)
|
converts MouseButton to MouseFlag |
parseKeyName(name)
|
Converts key name to KeyCode enum value For unknown key code, returns 0 |
registerActionEnum()
|
register enum items as action names and ids for lookup by actionIdToName and actionNameToId functions (names will be generated as "EnumName.EnumItemName") |
setActionAccelerators(actionId, accelerators)
|
overrides accelerators for action by id |
Interfaces
| Name | Description |
|---|---|
CustomEventTarget
|
Classes
| Name | Description |
|---|---|
Action
|
UI action |
CustomEvent
|
base class for custom events |
KeyEvent
|
Keyboard event |
MouseEvent
|
Mouse event |
QueueDestroyEvent
|
Queue destroy event. |
RunnableEvent
|
operation to execute (usually sent from background threads to run some code in UI thread) |
ScrollEvent
|
Slider/scrollbar event |
Structs
| Name | Description |
|---|---|
Accelerator
|
Keyboard accelerator (key + modifiers) |
ActionList
|
List of Actions, for looking up Action by key |
ActionMap
|
Map of Accelerator to Action |
ActionState
|
use to for requesting of action state (to enable/disable, hide, get check status, etc) |
ButtonDetails
|
Mouse button state details for MouseEvent |
Enums
| Name | Description |
|---|---|
ActionStateUpdateFlag
|
Define when action need state update - optimization for high frequently uses actions |
KeyAction
|
Keyboard actions for KeyEvent |
KeyCode
|
Key code constants for KeyEvent |
KeyFlag
|
Keyboard flags for KeyEvent |
MouseAction
|
Mouse action codes for MouseEvent |
MouseButton
|
Mouse button codes for MouseEvent |
MouseFlag
|
Mouse flag bits (mouse buttons and keyboard modifiers) for MouseEvent |
ScrollAction
|
Scroll bar / slider action codes for ScrollEvent. |
Global variables
| Name | Type | Description |
|---|---|---|
ACTION_SEPARATOR
|
Action
|
|
ACTION_STATE_CHECKED
|
const(ActionState)
|
|
ACTION_STATE_DISABLE
|
const(ActionState)
|
|
ACTION_STATE_ENABLED
|
const(ActionState)
|
|
ACTION_STATE_INVISIBLE
|
const(ActionState)
|
|
CUSTOM_RUNNABLE
|
immutable(int)
|
|
DOUBLE_CLICK_THRESHOLD_MS
|
long
|
double click max interval, milliseconds; may be changed by platform |
SEPARATOR_ACTION_ID
|
const(int)
|
use this ID for menu and toolbar separators |