|
RADLib
RADical C++ application framework
|
Input manager that reads evdev events and emits RADCore events. More...
#include <RADInput.h>
Inheritance diagram for RADInput::InputManager:
Collaboration diagram for RADInput::InputManager:Public Member Functions | |
| InputManager (InputPaths paths={}, RADCore::EventLoop *loop=nullptr) | |
| Creates a manager using paths and optional target event loop. More... | |
| ~InputManager () | |
| Stops all readers. More... | |
| std::vector< InputDeviceInfo > | discover () const |
| Discovers event devices from devInput and sysClassInput. More... | |
| bool | startDevice (const std::string &path, std::string *error=nullptr) |
| Starts reading a single evdev event path. More... | |
| void | startHotplugMonitor (int intervalMs=1000) |
| Starts lightweight polling hotplug detection and emits devicesChanged on changes. More... | |
| void | stopHotplugMonitor () |
| Stops the hotplug monitor thread. More... | |
| void | stopAll () |
| Stops all active readers. More... | |
| bool | isRunning () const |
| Returns true when at least one device reader is active. More... | |
| const InputPaths & | paths () const |
| Returns the configured paths. More... | |
Public Member Functions inherited from RADCore::RADObject | |
| RADObject () | |
| Creates a RADObject bound to the current thread. More... | |
| virtual | ~RADObject () |
| Disconnects tracked event links and releases lifetime token. More... | |
| void | registerLink (const ConnectionRecord &record) |
| Registers a connection for cleanup when this object is destroyed. More... | |
| std::thread::id | threadId () const |
| Returns the thread id this object is currently associated with. More... | |
| EventLoop * | associatedEventLoop () const |
| Returns the associated event loop, if any. More... | |
| ThreadAffinity | threadAffinity () const |
| Returns both thread id and associated loop atomically. More... | |
| std::weak_ptr< void > | lifetimeToken () const |
| Returns a weak token used to drop queued callbacks after destruction. More... | |
| void | moveToThread (std::thread::id tId, EventLoop *loop=nullptr) |
| Moves the object's affinity to tId and optional loop. More... | |
Public Attributes | |
| RADCore::Event< void(const RADInput::InputEvent &) > | eventReceived |
| Emitted when a raw input event is read. More... | |
| RADCore::Event< void(const std::vector< RADInput::InputDeviceInfo > &) > | devicesChanged |
| Emitted when discovery finds a changed device list. More... | |
Input manager that reads evdev events and emits RADCore events.
|
explicit |
Creates a manager using paths and optional target event loop.
| RADInput::InputManager::~InputManager | ( | ) |
Stops all readers.
| std::vector<InputDeviceInfo> RADInput::InputManager::discover | ( | ) | const |
Discovers event devices from devInput and sysClassInput.
| bool RADInput::InputManager::isRunning | ( | ) | const |
Returns true when at least one device reader is active.
| const InputPaths& RADInput::InputManager::paths | ( | ) | const |
Returns the configured paths.
| bool RADInput::InputManager::startDevice | ( | const std::string & | path, |
| std::string * | error = nullptr |
||
| ) |
Starts reading a single evdev event path.
| void RADInput::InputManager::startHotplugMonitor | ( | int | intervalMs = 1000 | ) |
Starts lightweight polling hotplug detection and emits devicesChanged on changes.
| void RADInput::InputManager::stopAll | ( | ) |
Stops all active readers.
| void RADInput::InputManager::stopHotplugMonitor | ( | ) |
Stops the hotplug monitor thread.
| RADCore::Event<void (const std::vector<RADInput::InputDeviceInfo>&) > RADInput::InputManager::devicesChanged |
Emitted when discovery finds a changed device list.
| RADCore::Event<void (const RADInput::InputEvent&) > RADInput::InputManager::eventReceived |
Emitted when a raw input event is read.