ReXGlue SDK
Loading...
Searching...
No Matches
rex::hid::IKeyCapture Class Referenceabstract

#include <rex/hid/binding.h>

Public Member Functions

virtual void SetPadButtons (u32 buttons)=0
virtual void Begin ()=0
virtual std::optional< InputSource > Poll (std::chrono::steady_clock::time_point now=std::chrono::steady_clock::now())=0
virtual bool IsPending () const =0
virtual bool WasCanceled () const =0

Detailed Description

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.

Member Function Documentation

◆ 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
nowThe 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
buttons1 bit per PadInput.

◆ 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: