Input class for Windows OS.
More...
#include <WindowsInput.h>
|
|
using | EventCallbackFn = std::function<void(Event&)> |
| static bool | IsKeyPressed (int keycode) |
| | Polling function for inquiry of key press.
|
| static bool | IsMouseButtonPressed (int button) |
| | Polling function for inquiry of mouse button press.
|
| static bool | IsMouseButtonReleased (int button) |
| | Polling function for the inquiry of mouse button release.
|
| static bool | IsControllerButtonPressed (int button, int cID) |
| | Polling function for the inquiry of game controller button pressed action.
|
| static float | ControllerAxisPivotVal (int axis, int cID) |
| | Polling function for the inquiry of the Axis pivot value (analog stick deflection for instance).
|
| static std::pair< float, float > | GetMousePosition () |
| | Polling function for the inquiry of mouse position (abscissa, ordinate).
|
| static float | GetMouseX () |
| | Polling function for the inquiry of abscissa.
|
| static float | GetMouseY () |
| | Polling function for the inquiry of ordinate.
|
| static InputRegisteringAPI | GetAPI () |
| | Getter for API (enum) in use for input.
|
| static void | DeInit () |
| | Deinitialize the Input system.
|
| static void | Init () |
| | Initialize the Input system for Karma.
|
| static std::shared_ptr< Input > | GetInputInstance () |
| | Getter for the Input instance.
|
| static void | DisplayControllerDevices () |
| | For debugging purposes, a function to print out the number of connected devices.
|
| static void | SetConnectedJoySticks () |
| | Create a list of connected joysticks (gamepads).
|
|
static std::list< std::shared_ptr< ControllerDevice > > | m_ControllerDevices |
Input class for Windows OS.
◆ WindowsInput()
| Karma::WindowsInput::WindowsInput |
( |
| ) |
|
A constructor.
- Since
- Karma 1.0.0
◆ ControllerAxisPivotValImpl()
| float Karma::WindowsInput::ControllerAxisPivotValImpl |
( |
int | axis, |
|
|
int | cID ) |
|
overrideprotectedvirtual |
Windows implementation of ControllerAxisPivotVal function.
- Parameters
-
| axis | The integer corresponding to gamepad controller axis For instance GLFW_GAMEPAD_AXIS_LEFT_X macro |
| cID | The controller device ID, defined in GLFW |
- Note
- GLFW API is used
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ GetMousePositionImpl()
| std::pair< float, float > Karma::WindowsInput::GetMousePositionImpl |
( |
| ) |
|
|
overrideprotectedvirtual |
Windows implementation of GetMousePosition function.
- Returns
- std::pair<float, float> The X and Y position of the mouse cursor
- Note
- GLFW API is used
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ GetMouseXImpl()
| float Karma::WindowsInput::GetMouseXImpl |
( |
| ) |
|
|
overrideprotectedvirtual |
Windows implementation of GetMouseX function.
- Returns
- float The X position of the mouse cursor
- Note
- GLFW API is used
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ GetMouseYImpl()
| float Karma::WindowsInput::GetMouseYImpl |
( |
| ) |
|
|
overrideprotectedvirtual |
Windows implementation of GetMouseY function.
- Returns
- float The Y position of the mouse cursor
- Note
- GLFW API is used
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ IsControllerButtonPressedImpl()
| bool Karma::WindowsInput::IsControllerButtonPressedImpl |
( |
int | button, |
|
|
int | cID ) |
|
overrideprotectedvirtual |
Windows implementation of IsControllerButtonPressed function.
- Parameters
-
| button | The integer corresponding to gamepad controller button For instance GLFW_GAMEPAD_BUTTON_A macro |
| cID | The controller device ID, defined in GLFW |
- Note
- GLFW API is used
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ IsKeyPressedImpl()
| bool Karma::WindowsInput::IsKeyPressedImpl |
( |
int | keycode | ) |
|
|
overrideprotectedvirtual |
Windows implementation of IsKeyPressed function.
- Parameters
-
- Note
- GLFW API is used
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ IsMouseButtonPressedImpl()
| bool Karma::WindowsInput::IsMouseButtonPressedImpl |
( |
int | button | ) |
|
|
overrideprotectedvirtual |
Windows implementation of IsMouseButtonPressed function.
- Parameters
-
| button | The integer corresponding to mouse button. For instance GLFW_MOUSE_BUTTON_1 macro |
- Note
- GLFW API is used
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ IsMouseButtonReleasedImpl()
| bool Karma::WindowsInput::IsMouseButtonReleasedImpl |
( |
int | button | ) |
|
|
overrideprotectedvirtual |
Windows implementation of IsMouseButtonReleased function.
- Parameters
-
| button | The integer corresponding to mouse button. For instance GLFW_MOUSE_BUTTON_1 macro |
- Note
- GLFW API is used
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ OnControllerDeviceConnected()
Event handler for Controller Device Connected event.
- Parameters
-
- Since
- Karma 1.0.0
◆ OnControllerDeviceDisconnected()
Event handler for Controller Device Disconnected event.
- Parameters
-
- Since
- Karma 1.0.0
◆ SetEventCallback()
| void Karma::WindowsInput::SetEventCallback |
( |
const EventCallbackFn & | callback, |
|
|
Window * | window ) |
|
overridevirtual |
Set the event callback for the Windows Input.
- Parameters
-
| callback | The function to be called when Input event is receieved from GLFW. |
| window | The handle of GLFW window |
- Since
- Karma 1.0.0
Implements Karma::Input.
The documentation for this class was generated from the following files:
- Karma/src/Platform/Windows/WindowsInput.h
- Karma/src/Platform/Windows/WindowsInput.cpp