EternusKeycodes

Static class that holds keycode enumerations

Comment

Keycodes are directly named from their SDL couter part (without the prefix ‘SDL_’) See - https://wiki.libsdl.org/SDL_Keycode

Exceptions MOUSE_LCLICK MOUSE_MIDDLE MOUSE_RCLICK MOUSE_WHEEL_UP MOUSE_WHEEL_DOWN

Example

if Eternus.InputSystem:NKIsDown(EternusKeycodes.t) then -- handle whe t / T is down end

See Also

https://wiki.libsdl.org/SDL_Keycode

Summary
EternusKeycodesStatic class that holds keycode enumerations
InputSystemSystem facilitating input event management and callbacks.
Functions
NKIsDownReturn the status of a key by keycode.
NKIsUpReturn the status of a key by keycode.
NKGetFunctionDownReturns whether or not the key bound to a given function is currently being held.
NKToggleMouseToggle mouse visibility.
NKShowMouseShows the mouse.
NKHideMouseHides the mouse.
NKIsMouseHiddenReturns the visiblility of the mouse.
NKIsMouseGrabbedReturns the grab state of the mouse input
NKGetMouseXThe mouse X (vertical) axis.
NKGetMouseYThe mouse Y (horizontal) axis.
NKGetMouseZThe mouse Z (scroll wheel) axis
NKGetMouseAxis
NKSetMousePositionSets the cursor position to x, y within the game window
NKCenterMouseCenters the cursor to the center of the game window
NKGrabMouseInputGrabs the mouse motion and binds it within the window center.
NKReleaseMouseInputReleases the mouse input from the window and back to the mouse hardware.
NKFlushAllInputStatesNowAttempts to clear all processing keybound functions and input states as soon as possible instead of waiting until next frame.
NKPushInputContextPushes a keybind mapping to the top of the keybind stack.
NKRemoveInputContextRemoves a keybind mapping from the stack (order will be preserved)

InputSystem

System facilitating input event management and callbacks.

See Also

InputMappingContext

Summary
Functions
NKIsDownReturn the status of a key by keycode.
NKIsUpReturn the status of a key by keycode.
NKGetFunctionDownReturns whether or not the key bound to a given function is currently being held.
NKToggleMouseToggle mouse visibility.
NKShowMouseShows the mouse.
NKHideMouseHides the mouse.
NKIsMouseHiddenReturns the visiblility of the mouse.
NKIsMouseGrabbedReturns the grab state of the mouse input
NKGetMouseXThe mouse X (vertical) axis.
NKGetMouseYThe mouse Y (horizontal) axis.
NKGetMouseZThe mouse Z (scroll wheel) axis
NKGetMouseAxis
NKSetMousePositionSets the cursor position to x, y within the game window
NKCenterMouseCenters the cursor to the center of the game window
NKGrabMouseInputGrabs the mouse motion and binds it within the window center.
NKReleaseMouseInputReleases the mouse input from the window and back to the mouse hardware.
NKFlushAllInputStatesNowAttempts to clear all processing keybound functions and input states as soon as possible instead of waiting until next frame.
NKPushInputContextPushes a keybind mapping to the top of the keybind stack.
NKRemoveInputContextRemoves a keybind mapping from the stack (order will be preserved)

Functions

NKIsDown

Return the status of a key by keycode.

Parameters

intThe keycode of the key to query.

Returns

boolTrue if the key was pressed at the start of this frame, false otherwise.

NKIsUp

Return the status of a key by keycode.

Parameters

intThe keycode of the key to query.

Returns

boolTrue if the key was not pressed at the start of this frame, false otherwise.

NKGetFunctionDown

Returns whether or not the key bound to a given function is currently being held.

Parameters

stringThe name of the function to check.

Returns

boolWhether or not the key for the given function was down at the start of this frame.

NKToggleMouse

Toggle mouse visibility.

NKShowMouse

Shows the mouse.

NKHideMouse

Hides the mouse.

NKIsMouseHidden

Returns the visiblility of the mouse.

NKIsMouseGrabbed

Returns the grab state of the mouse input

NKGetMouseX

The mouse X (vertical) axis.  If mouse input is grabbed this will instead return the delta on the X axis.

NKGetMouseY

The mouse Y (horizontal) axis.  If mouse input is grabbed this will instead return the delta on the Y axis.

NKGetMouseZ

The mouse Z (scroll wheel) axis

NKGetMouseAxis

The current axis of the mouse, X(vertical), Y(horizontal, Z(scroll wheel).  If mouse input is grabbed this will instead return the deltas for the X and Y AxisZ does not change.

NKSetMousePosition

Sets the cursor position to x, y within the game window

Paramaters

intx
inty

NKCenterMouse

Centers the cursor to the center of the game window

NKGrabMouseInput

Grabs the mouse motion and binds it within the window center.  Hides the cursor.

NKReleaseMouseInput

Releases the mouse input from the window and back to the mouse hardware.  Shows the cursor.

NKFlushAllInputStatesNow

Attempts to clear all processing keybound functions and input states as soon as possible instead of waiting until next frame.

NKPushInputContext

Pushes a keybind mapping to the top of the keybind stack.

Paramaters

InputMappingContextThe context to push on to the top of the keybinds stack.

NKRemoveInputContext

Removes a keybind mapping from the stack (order will be preserved)

Paramaters

InputMappingContextThe context to remove from the keybinds stack.
Represents a mapping of keybinds.
Close