Module input

Types

TKeyEventKind = enum 
  down, up
keyboard key event kind
TKeyEvent = tuple[key: TKey, event: TKeyEventKind]
keyboard key event
TButtonEvent = tuple[button: int, event: TKeyEventKind]
mouse button event

Procs

proc resetKeyEvents() {.inline.}
proc resetButtonEvents() {.inline.}
proc addKeyEvent(key: TKey; event: TKeyEventKind) {.inline.}
proc addButtonEvent(btn: int; event: TKeyEventKind) {.inline.}
proc isKeyEvent(key: TKey; event: TKeyEventKind): bool
proc isButtonEvent(btn: int; event: TKeyEventKind): bool
proc keyPressed(key: TKey): bool {.inline.}
Check if key is pressed now.
proc buttonPressed(btn: int): bool {.inline.}
Check if mouse button btn is pressed now.
proc mousePos(): TPoint {.inline.}
Get mouse position.
proc mouseRelativePos(): TPoint {.inline.}
Get relative mouse position.

Templates

template isKeyDown(key: TKey): bool
template isKeyUp(key: TKey): bool
template isButtonDown(btn: int): bool
template isButtonUp(btn: int): bool
Generated: 2012-11-11 20:09:27 UTC