Module touch

touch.nim

Include file for SDL touch event handling.

Types

TouchID* = int64
FingerID* = int64
Finger* = object
  id*: FingerID
  x*: cfloat
  y*: cfloat
  pressure*: cfloat

Consts

TOUCH_MOUSEID* = uint32(- 1)
Used as the device ID for mouse events simulated with touch input

Procs

proc getNumTouchDevices*(): cint {.
cdecl, importc: "SDL_GetNumTouchDevices", dynlib: SDL2_LIB
.}
Get the number of registered touch devices.
proc getTouchDevice*(index: cint): TouchID {.
cdecl, importc: "SDL_GetTouchDevice", dynlib: SDL2_LIB
.}
Get the touch ID with the given index, or 0 if the index is invalid.
proc getNumTouchFingers*(touchID: TouchID): cint {.
cdecl, importc: "SDL_GetNumTouchFingers", dynlib: SDL2_LIB
.}
Get the number of active fingers for a given touch device.
proc getTouchFinger*(touchID: TouchID; index: cint): ptr Finger {.
cdecl, importc: "SDL_GetTouchFinger", dynlib: SDL2_LIB
.}
Get the finger object of the given touch, with the given index.