Rishka
RISC-V virtual runtime in C/C++ made for ESP32-WROVER
Keyboard Class Referencefinal

Provides access to keyboard-related functionalities in the Rishka VM SDK. More...

#include <keyboard.h>

Static Public Member Functions

static string layout_name ()
 Get the name of the current keyboard layout. More...
 
static string layout_desc ()
 Get the description of the current keyboard layout. More...
 
static PS2Device device_type ()
 Get the type of the keyboard device. More...
 
static bool is_num_lock ()
 Check if the Num Lock key is currently active. More...
 
static bool is_caps_lock ()
 Check if the Caps Lock key is currently active. More...
 
static bool is_scroll_lock ()
 Check if the Scroll Lock key is currently active. More...
 
static void num_lock (bool state)
 Set the state of the Num Lock key. More...
 
static void caps_lock (bool state)
 Set the state of the Caps Lock key. More...
 
static void scroll_lock (bool state)
 Set the state of the Scroll Lock key. More...
 
static u32 next_scancode (i32 timeout, bool resend)
 Get the next keyboard scan code. More...
 
static void lock (i32 timeout)
 Lock the keyboard to prevent input. More...
 
static void unlock ()
 Unlock the keyboard to allow input. More...
 
static void reset ()
 Reset the keyboard to its default state. More...
 

Detailed Description

Provides access to keyboard-related functionalities in the Rishka VM SDK.

The Keyboard class allows interaction with keyboard-related functionalities in the Rishka VM SDK. It provides methods to retrieve information about the keyboard layout, check the status of lock keys (Num Lock, Caps Lock, Scroll Lock), control the state of these lock keys, obtain keyboard scan codes, and perform operations such as locking, unlocking, and resetting the keyboard.

Member Function Documentation

◆ caps_lock()

void Keyboard::caps_lock ( bool  state)
static

Set the state of the Caps Lock key.

This method allows setting the state of the Caps Lock key.

Parameters
stateThe desired state of the Caps Lock key (true for active, false for inactive).

◆ device_type()

PS2Device Keyboard::device_type ( )
static

Get the type of the keyboard device.

This method retrieves the type of the connected keyboard device.

Returns
The type of the keyboard device as a PS2Device enumeration value.

◆ is_caps_lock()

bool Keyboard::is_caps_lock ( )
static

Check if the Caps Lock key is currently active.

This method checks whether the Caps Lock key is currently active.

Returns
True if the Caps Lock key is active, false otherwise.

◆ is_num_lock()

bool Keyboard::is_num_lock ( )
static

Check if the Num Lock key is currently active.

This method checks whether the Num Lock key is currently active.

Returns
True if the Num Lock key is active, false otherwise.

◆ is_scroll_lock()

bool Keyboard::is_scroll_lock ( )
static

Check if the Scroll Lock key is currently active.

This method checks whether the Scroll Lock key is currently active.

Returns
True if the Scroll Lock key is active, false otherwise.

◆ layout_desc()

string Keyboard::layout_desc ( )
static

Get the description of the current keyboard layout.

This method retrieves the description of the currently selected keyboard layout.

Returns
String representing the description of the keyboard layout.

◆ layout_name()

string Keyboard::layout_name ( )
static

Get the name of the current keyboard layout.

This method retrieves the name of the currently selected keyboard layout.

Returns
A string representing the name of the keyboard layout.

◆ lock()

void Keyboard::lock ( i32  timeout)
static

Lock the keyboard to prevent input.

This method locks the keyboard to prevent input.

Parameters
timeoutThe duration for which to lock the keyboard (in milliseconds).

◆ next_scancode()

u32 Keyboard::next_scancode ( i32  timeout,
bool  resend 
)
static

Get the next keyboard scan code.

This method retrieves the next keyboard scan code.

Parameters
timeoutThe maximum time to wait for a scan code (in milliseconds).
resendFlag indicating whether to resend previous scan codes.
Returns
The next keyboard scan code as an unsigned 32-bit integer.

◆ num_lock()

void Keyboard::num_lock ( bool  state)
static

Set the state of the Num Lock key.

This method allows setting the state of the Num Lock key.

Parameters
stateThe desired state of the Num Lock key (true for active, false for inactive).

◆ reset()

void Keyboard::reset ( )
static

Reset the keyboard to its default state.

This method resets the keyboard to its default state.

◆ scroll_lock()

void Keyboard::scroll_lock ( bool  state)
static

Set the state of the Scroll Lock key.

This method allows setting the state of the Scroll Lock key.

Parameters
stateThe desired state of the Scroll Lock key (true for active, false for inactive).

◆ unlock()

void Keyboard::unlock ( )
static

Unlock the keyboard to allow input.

This method unlocks the keyboard to allow input.


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