default
tksdl
tksdltksdl.SDLdelay(int millisec) - Suspend thread for the given number of millisec
enableKeyRepeat(int delay, rate) - Configure SDL key repeat
enableUNICODE(boolean bEnabled) - Configure whether unicode conversion shall be performed when processing keyboard events
eventLoop() - Enter SDL event loop.
exitEventLoop() - Exit SDL event loop.
getCursorZoom() : int - Query cursor shape zoom factor
getEventPolling() : boolean - Query whether blocking waits shall be used when retrieving the next SDL message
getJoystick(int dev) : Joystick - Return Joystick device object. Lazy-inits SDL JOYSTICK subsystem.
getNumJoysticks() : int - Query number of available joystick devices. Lazy-inits SDL JOYSTICK subsystem.
getRedrawFlag() : int - Query redraw behaviour
getTicks() : int - Return number of ticks (millisec) since app. start
getTimerInterval() : int - Query timer interval.
isApplicationActive() : boolean - Query whether the application windows is currently in the foreground.
reportJoystickEvent(boolean bEnable) - Configure whether joystick events shall be reported
sendEvent(String ev) - Post event message to event queue
setCursorZoom(int zoom) - Sets cursor shape zoom factor (e.g. for Linux 4k screens)
setEventPolling(boolean bEnabled) - Configure whether blocking waits shall be used when retrieving the next SDL message
setIconFromBMP(Buffer bmpData) - Set window icon
setRedrawFlag(int flags) - Control redraw behaviour
setTimerInterval(int intervalMillisec) - Set timer interval for onTimer() signal/callback.
triggerEvent(String ev) - Immediately send user event
updateJoysticks() - Update joystick stateint DEFAULT_KEYBOARD_REPEAT_DELAY -
int DEFAULT_KEYBOARD_REPEAT_INTERVAL -
int MOUSE_LBUTTON -
int MOUSE_MBUTTON -
int MOUSE_POINTER_ENTER -
int MOUSE_POINTER_MANUAL -
int MOUSE_POINTER_MOVE -
int MOUSE_RBUTTON -
int MOUSE_WHEELDOWN -
int MOUSE_WHEELUP -
int REDRAW_ALL -
int REDRAW_DIRTY -
int SDL_NOFRAME -
int SDL_RESIZABLE -
Please notice that some functionality is placed in separate classes (Mouse, Viewport, AudioDevice, Cursor, FPS)
This class uses the following signals/callbacks:
- onKeyboard(Key k) - Called when a key was pressed or released- onMouse(int absx, int absy, int currbuttonstate, int changedbuttonstate) - Called when a mouse event occured- onJoyAxisMotion(int dev, int axis, int val)- onJoyButton(int dev, int button, int pressed)- onJoyHatMotion(int dev, int hat, int state)- onJoyBallMotion(int dev, int hat, int dx, int dy)- onDraw() - Called when window/view needs to be redrawn- onOpen() - Called after window/view has been opened- onClose() - Called when window/view is about to be closed. By returning false in the callback function, the window/view can be prevented from closing (e.g. if the user has clicked the window close button)- onResize() - Called after window/view has been resized (onOpen() is called immediately after)- onEvent(Event ev) - Called when user event has been received (see sendEvent()())- onExpose() - Called when (parts) of the window/view have become visible- onApplicationActive(boolean bActive) - Called when application window/view becomes active- onMouseFocusActive(boolean bActive)- onInputFocusActive(boolean bActive)- onIdle() - **Deprecated**, only called regularly when event polling is enabled (see setEventPolling()())- onDropFiles() - Called when one or more files were dragged and dropped onto the window/view [win32 only]- onTimer() - Called from timer thread when interval has been configured using setTimerInterval().
Method delay | |||||
Deprecated: Use TKS.sleep()() instead | |||||
Suspend thread for the given number of millisec | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method enableKeyRepeat | |||||||||||||||
Deprecated: Since this is a global setting it is recommend to use the tkui (per widget) keyrepeat mechanism instead | |||||||||||||||
Configure SDL key repeat | |||||||||||||||
Signature | |||||||||||||||
| |||||||||||||||
Arguments | |||||||||||||||
| |||||||||||||||
Description | |||||||||||||||
This is a wrapper for the SDL_EnableKeyRepeat() native function. (note) in SDL2 build, key repeat events are filtered out when (0 == _rate). |
Method enableUNICODE | |||||
Configure whether unicode conversion shall be performed when processing keyboard events | |||||
Signature | |||||
| |||||
Arguments | |||||
| |||||
Description | |||||
This is a wrapper for the SDL_EnableUNICODE() native function. No-Op in SDL2 build. |
Method eventLoop | |||
Enter SDL event loop. | |||
Signature | |||
| |||
Description | |||
This method does not return until the window is closed resp. exitEventLoop() is called. |
Method exitEventLoop | |||
Exit SDL event loop. | |||
Signature | |||
| |||
Description | |||
This causes the eventLoop() method to return. |
Method getCursorZoom | |||||
Query cursor shape zoom factor | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getEventPolling | |||||
Query whether blocking waits shall be used when retrieving the next SDL message | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getJoystick | ||||||||||
Return Joystick device object. Lazy-inits SDL JOYSTICK subsystem. | ||||||||||
Signature | ||||||||||
| ||||||||||
Arguments | ||||||||||
| ||||||||||
Returns | ||||||||||
Method getNumJoysticks | |||||
Query number of available joystick devices. Lazy-inits SDL JOYSTICK subsystem. | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getRedrawFlag | |||||
Query redraw behaviour | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getTicks | |||||
Deprecated: Use the milliSeconds()() core function instead | |||||
Return number of ticks (millisec) since app. start | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method getTimerInterval | |||||
Query timer interval. | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method isApplicationActive | |||||
Query whether the application windows is currently in the foreground. | |||||
Signature | |||||
| |||||
Returns | |||||
|
Method reportJoystickEvent | |||||
Configure whether joystick events shall be reported | |||||
Signature | |||||
| |||||
Arguments | |||||
| |||||
Description | |||||
This is a wrapper for the SDL_JoystickEventState() native function. |
Method sendEvent | |||||
Post event message to event queue | |||||
Signature | |||||
| |||||
Arguments | |||||
| |||||
Description | |||||
Useful for asynchronous thread communication. This method is usually called from a thread different to the main/UI thread. |
Method setCursorZoom | |||||
Sets cursor shape zoom factor (e.g. for Linux 4k screens) | |||||
Signature | |||||
| |||||
Arguments | |||||
| |||||
Description | |||||
Default is 1. |
Method setEventPolling | |||||
Configure whether blocking waits shall be used when retrieving the next SDL message | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method setIconFromBMP | |||||
Set window icon | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method setRedrawFlag | |||||
Control redraw behaviour | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method setTimerInterval | |||||
Set timer interval for onTimer() signal/callback. | |||||
Signature | |||||
| |||||
Arguments | |||||
| |||||
Description | |||||
The timer is started when eventLoop()() is called and stops when exitEventLoop()() is called.
Warning: The timer callback runs in its own thread. |
Method triggerEvent | |||||
| Deprecated: Call your event handler directly instead | |||||
Immediately send user event | |||||
Signature | |||||
| |||||
Arguments | |||||
|
Method updateJoysticks | |||
Update joystick state | |||
Signature | |||
| |||
Description | |||
This is a wrapper for the SDL_JoystickUpdate() native function. |
Constant DEFAULT_KEYBOARD_REPEAT_DELAY (int) | |
Constant DEFAULT_KEYBOARD_REPEAT_INTERVAL (int) | |
Constant MOUSE_LBUTTON (int) | |
Constant MOUSE_MBUTTON (int) | |
Constant MOUSE_POINTER_ENTER (int) | |
Constant MOUSE_POINTER_MANUAL (int) | |
Constant MOUSE_POINTER_MOVE (int) | |
Constant MOUSE_RBUTTON (int) | |
Constant MOUSE_WHEELDOWN (int) | |
Constant MOUSE_WHEELUP (int) | |
Constant REDRAW_ALL (int) | |
Constant REDRAW_DIRTY (int) | |
Constant SDL_NOFRAME (int) | |
Constant SDL_RESIZABLE (int) | |
| Project Modules: | tksdl |
| Project Classes: | AudioDevice , AudioSample , Cursor , FPS , Joystick , Key , Mouse , SamplePlayer , SDL , Viewport |
| Project Functions: | MIDINoteToFrequency |
| All Namespaces: | default , graph , ui |
| All Projects: | core , eqxmms , ShaderVG , ShaderVG_Text , tkanalogrytm , tkchipmunk , tkclap , tkfileutils , tkfreeglut , tkfreetype2 , tkfreeverb , tkmath , tkmidi , tkmidipipe , tkminnie , tkoldmath , tkopengl , tkportaudio , tkradiastools , tksamplechain , tksampleedit , tksampler , tksdl , tksdl_net , tksidplay2 , tkspeexdsp , tksqlite , tktriangulate , tkui , tkvst2 , tkzip , ui , yingtest |
auto-generated by "DOG", the TkScript document generator. Thu, 11/Dec/2025 13:42:00