#include <rex/hid/binding.h>
Waits for the next key, mouse button, wheel step or pad button the user presses. A key is reported once released. Cancel is Escape held for KeyCaptureConfig::cancel_hold or the pad cancel buttons. Create one with IInputSystem::CreateKeyCapture. UI thread only.
◆ Begin()
| virtual void rex::hid::IKeyCapture::Begin |
( |
| ) |
|
|
pure virtual |
Starts a capture. Keys and buttons held at the start are ignored until released.
◆ IsPending()
| virtual bool rex::hid::IKeyCapture::IsPending |
( |
| ) |
const |
|
nodiscardpure virtual |
Reports whether an input was pressed and is waiting for its release. The pad cancel buttons are ignored until Poll reports the input.
- Returns
- True from the press of the input until Poll reports it.
◆ Poll()
| virtual std::optional< InputSource > rex::hid::IKeyCapture::Poll |
( |
std::chrono::steady_clock::time_point | now = std::chrono::steady_clock::now() | ) |
|
|
nodiscardpure virtual |
Returns the next completed input, or empty while none is complete or the capture is not running. Modifiers held at the press join a key input. The capture ends when an input is returned or canceled.
- Parameters
-
| now | The current time, which tests replace. |
◆ SetPadButtons()
| virtual void rex::hid::IKeyCapture::SetPadButtons |
( |
u32 | buttons | ) |
|
|
pure virtual |
Sets the pad buttons that are held now, polled by the application from its pad driver.
- Parameters
-
◆ WasCanceled()
| virtual bool rex::hid::IKeyCapture::WasCanceled |
( |
| ) |
const |
|
nodiscardpure virtual |
Reports whether the last capture ended by cancel.
- Returns
- True after a cancel, until the next Begin.
The documentation for this class was generated from the following file: