Input class for Linux based OS.
More...
#include <LinuxInput.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 Linux based OS.
◆ LinuxInput()
Karma::LinuxInput::LinuxInput |
( |
| ) |
|
A constructor.
- Since
- Karma 1.0.0
◆ ControllerAxisPivotValImpl()
float Karma::LinuxInput::ControllerAxisPivotValImpl |
( |
int | axis, |
|
|
int | cID ) |
|
overrideprotectedvirtual |
Linux implementation of ControllerAxisPivotVal function.
- Parameters
-
axis | The horizontal/vertical directional deflection of the axis (GLFW axes). GLFW_GAMEPAD_AXIS_LEFT_Y is an example. |
cID | The ID of the attached controller, defined in GLFW |
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ GetMousePositionImpl()
std::pair< float, float > Karma::LinuxInput::GetMousePositionImpl |
( |
| ) |
|
|
overrideprotectedvirtual |
Linux implementation of GetMousePosition function.
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ GetMouseXImpl()
float Karma::LinuxInput::GetMouseXImpl |
( |
| ) |
|
|
overrideprotectedvirtual |
Linux implementation of GetMouseX function.
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ GetMouseYImpl()
float Karma::LinuxInput::GetMouseYImpl |
( |
| ) |
|
|
overrideprotectedvirtual |
Linux implementation of GetMouseY function.
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ IsControllerButtonPressedImpl()
bool Karma::LinuxInput::IsControllerButtonPressedImpl |
( |
int | button, |
|
|
int | cID ) |
|
overrideprotectedvirtual |
Linux 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 |
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ IsKeyPressedImpl()
bool Karma::LinuxInput::IsKeyPressedImpl |
( |
int | keycode | ) |
|
|
overrideprotectedvirtual |
Linux implementation of Linux IsKeyPressed function.
- Parameters
-
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ IsMouseButtonPressedImpl()
bool Karma::LinuxInput::IsMouseButtonPressedImpl |
( |
int | button | ) |
|
|
overrideprotectedvirtual |
Linux implementation of Linux IsMouseButtonPressed function.
- Parameters
-
button | The integer corresponding to mouse button. For instance GLFW_MOUSE_BUTTON_1 macro |
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ IsMouseButtonReleasedImpl()
bool Karma::LinuxInput::IsMouseButtonReleasedImpl |
( |
int | button | ) |
|
|
overrideprotectedvirtual |
Linux implementation of IsMouseButtonReleased function.
- Parameters
-
button | The integer corresponding to mouse button. For instance GLFW_MOUSE_BUTTON_1 macro |
- Since
- Karma 1.0.0
Implements Karma::Input.
◆ SetEventCallback()
void Karma::LinuxInput::SetEventCallback |
( |
const EventCallbackFn & | callback, |
|
|
Window * | window ) |
|
overridevirtual |
Set the event callback for the Linux Input.
- Parameters
-
callback | The function to be called when Input event is receieved from GLFW. Usually Application::OnEvent(), which dispatches the Events, is fed into as lambda for instance in glfwSetJoystickCallback |
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/Linux/LinuxInput.h
- Karma/src/Platform/Linux/LinuxInput.cpp