dlangui.core.events

This module contains dlangui event types declarations.

Event types: MouseEvent, KeyEvent, ScrollEvent.

Action and Accelerator.

Members

Classes

Action
class Action

UI action

CustomEvent
class CustomEvent

base class for custom events

KeyEvent
class KeyEvent

Keyboard event

MouseEvent
class MouseEvent

Mouse event

QueueDestroyEvent
class QueueDestroyEvent

Queue destroy event.

RunnableEvent
class RunnableEvent

operation to execute (usually sent from background threads to run some code in UI thread)

ScrollEvent
class ScrollEvent

Slider/scrollbar event

Enums

ActionStateUpdateFlag
enum ActionStateUpdateFlag

Define when action need state update - optimization for high frequently uses actions

KeyAction
enum KeyAction

Keyboard actions for KeyEvent

KeyCode
enum KeyCode

Key code constants for KeyEvent

KeyFlag
enum KeyFlag

Keyboard flags for KeyEvent

MouseAction
enum MouseAction

Mouse action codes for MouseEvent

MouseButton
enum MouseButton

Mouse button codes for MouseEvent

MouseFlag
enum MouseFlag

Mouse flag bits (mouse buttons and keyboard modifiers) for MouseEvent

ScrollAction
enum ScrollAction

Scroll bar / slider action codes for ScrollEvent.

Functions

actionIdToName
string actionIdToName(int id)

converts id to name for actions registered by registerActionEnum, returns null if not found

actionNameToId
int actionNameToId(string name)

converts action name id for for actions registered by registerActionEnum, returns 0 if not found

clearActionAcceleratorsMap
void clearActionAcceleratorsMap()

clear global action accelerators map

findActionAccelerators
Accelerator[] findActionAccelerators(int actionId)

lookup accelerators override for action by id

findActionAccelerators
Accelerator[] findActionAccelerators(string actionName)

lookup accelerators override for action by name (e.g. "EditorActions.ToggleLineComment")

keyName
string keyName(uint keyCode)

Converts KeyCode enum value to human readable key name

mouseButtonToFlag
ushort mouseButtonToFlag(MouseButton btn)

converts MouseButton to MouseFlag

parseKeyName
uint parseKeyName(string name)

Converts key name to KeyCode enum value For unknown key code, returns 0

registerActionEnum
void registerActionEnum()

register enum items as action names and ids for lookup by actionIdToName and actionNameToId functions (names will be generated as "EnumName.EnumItemName")

setActionAccelerators
void setActionAccelerators(int actionId, Accelerator[] accelerators)

overrides accelerators for action by id

Interfaces

CustomEventTarget
interface CustomEventTarget
Undocumented in source.

Static functions

matchKeyFlags
bool matchKeyFlags(uint eventFlags, uint requestedFlags)

Match key flags

Static variables

ACTION_SEPARATOR
Action ACTION_SEPARATOR;
Undocumented in source.
DOUBLE_CLICK_THRESHOLD_MS
long DOUBLE_CLICK_THRESHOLD_MS;

double click max interval, milliseconds; may be changed by platform

Structs

Accelerator
struct Accelerator

Keyboard accelerator (key + modifiers)

ActionList
struct ActionList

List of Actions, for looking up Action by key

ActionMap
struct ActionMap

Map of Accelerator to Action

ActionState
struct ActionState

use to for requesting of action state (to enable/disable, hide, get check status, etc)

ButtonDetails
struct ButtonDetails

Mouse button state details for MouseEvent

Variables

ACTION_STATE_CHECKED
auto ACTION_STATE_CHECKED;
Undocumented in source.
ACTION_STATE_DISABLE
auto ACTION_STATE_DISABLE;
Undocumented in source.
ACTION_STATE_ENABLED
auto ACTION_STATE_ENABLED;
Undocumented in source.
ACTION_STATE_INVISIBLE
auto ACTION_STATE_INVISIBLE;
Undocumented in source.
CUSTOM_RUNNABLE
int CUSTOM_RUNNABLE;
Undocumented in source.
SEPARATOR_ACTION_ID
int SEPARATOR_ACTION_ID;

use this ID for menu and toolbar separators

Meta

License

Boost License 1.0

Authors

Vadim Lopatin, coolreader.org@gmail.com