Antkeeper  0.0.1
Public Member Functions | List of all members
input::keyboard Class Reference

A virtual keyboard which generates keyboard-related input events. More...

#include <keyboard.hpp>

Inheritance diagram for input::keyboard:
input::device

Public Member Functions

void press (scancode scancode, std::uint16_t modifiers=modifier_key::none, bool repeat=false)
 Simulates a key press. More...
 
void release (scancode scancode, std::uint16_t modifiers=modifier_key::none)
 Simulates a key release. More...
 
::event::channel< key_pressed_event > & get_key_pressed_channel () noexcept
 Returns the channel through which key pressed events are published. More...
 
::event::channel< key_released_event > & get_key_released_channel () noexcept
 Returns the channel through which key released events are published. More...
 
constexpr device_type get_device_type () const noexcept override
 Returns device_type::keyboard. More...
 
- Public Member Functions inherited from input::device
void connect ()
 Simulates the device being connected. More...
 
void disconnect ()
 Simulates the device being disconnected. More...
 
bool is_connected () const noexcept
 Returns true if the device is currently connected. More...
 
void set_uuid (const ::uuid &id)
 Sets the universally unique identifier (UUID) of this input device. More...
 
const ::uuidget_uuid () const noexcept
 Returns the universally unique identifier (UUID) of this input device. More...
 
::event::channel< device_connected_event > & get_connected_channel () noexcept
 Returns the channel through which device connected events are published. More...
 
::event::channel< device_disconnected_event > & get_disconnected_channel () noexcept
 Returns the channel through which device disconnected events are published. More...
 

Detailed Description

A virtual keyboard which generates keyboard-related input events.

Definition at line 34 of file keyboard.hpp.

Member Function Documentation

◆ get_device_type()

constexpr device_type input::keyboard::get_device_type ( ) const
inlineconstexproverridevirtualnoexcept

Returns device_type::keyboard.

Implements input::device.

Definition at line 67 of file keyboard.hpp.

◆ get_key_pressed_channel()

::event::channel<key_pressed_event>& input::keyboard::get_key_pressed_channel ( )
inlinenoexcept

Returns the channel through which key pressed events are published.

Definition at line 55 of file keyboard.hpp.

◆ get_key_released_channel()

::event::channel<key_released_event>& input::keyboard::get_key_released_channel ( )
inlinenoexcept

Returns the channel through which key released events are published.

Definition at line 61 of file keyboard.hpp.

◆ press()

void input::keyboard::press ( scancode  scancode,
std::uint16_t  modifiers = modifier_key::none,
bool  repeat = false 
)

Simulates a key press.

Parameters
scancodeScancode of the key to press.
modifiersBit mask containing the active modifier keys.
repeattrue if the key press is from a key repeat, false otherwise.

Definition at line 25 of file keyboard.cpp.

◆ release()

void input::keyboard::release ( scancode  scancode,
std::uint16_t  modifiers = modifier_key::none 
)

Simulates a key release.

Parameters
scancodeScancode of the key to release.
modifiersBit mask containing the active modifier keys.

Definition at line 30 of file keyboard.cpp.


The documentation for this class was generated from the following files: