nCine::Backends::GlfwInputManager class

GLFW-based input manager.

Parses GLFW window, keyboard, mouse and joystick events and dispatches them to the registered input event handler, and exposes the current input device states.

Base classes

class nCine::IInputManager
Interface for querying input state and dispatching input events.

Public static functions

static auto HasFocus() -> bool
Returns true if the window currently has input focus.
static void AttachAuxiliaryWindow(GLFWwindow* window)
Lets input over a window besides the main one go where input over the main window goes, see AuxiliaryWindow.
static void UpdateJoystickStates()
Updates joystick state structures and simulates events.

Constructors, destructors, conversion operators

GlfwInputManager()
~GlfwInputManager() override

Public functions

auto GetMouseState() const -> const MouseState& override
Returns the current mouse state.
auto GetKeyboardState() const -> const KeyboardState& override
Returns the current keyboard state.
auto GetClipboardText() const -> String override
Returns the clipboard text, or empty if none.
auto SetClipboardText(StringView text) -> bool override
Sets the clipboard text.
auto IsJoyPresent(int joyId) const -> bool override
Returns true if the specified joystick is connected.
auto GetJoyName(int joyId) const -> const char* override
Returns the name of the specified joystick.
auto GetJoyGuid(int joyId) const -> const JoystickGuid override
Returns the GUID of the specified joystick.
auto GetJoyButtonCount(int joyId) const -> int override
Returns the number of buttons of the specified joystick.
auto GetJoyHatCount(int joyId) const -> int override
Returns the number of hats of the specified joystick.
auto GetJoyAxisCount(int joyId) const -> int override
Returns the number of axes of the specified joystick.
auto GetJoystickState(int joyId) const -> const JoystickState& override
Returns the raw state of the specified joystick.
auto JoystickRumble(int joyId, float lowFreqIntensity, float highFreqIntensity, uint32_t durationMs) -> bool override
Starts a low/high frequency rumble effect for the specified duration in milliseconds.
auto JoystickRumbleTriggers(int joyId, float left, float right, uint32_t durationMs) -> bool override
Starts a left/right trigger rumble effect for the specified duration in milliseconds.
void SetCursor(Cursor cursor) override
Sets the mouse cursor mode.