MicrOS
micros_keyboard.c File Reference
#include "micros_keyboard.h"

Functions

bool micros_keyboard_is_key_pressed ()
 Checks if any key is pressed. More...
 
bool micros_keyboard_get_pressed_key (micros_keyboard_scan_ascii_pair *scan_ascii_pair)
 Retrieves pressed key from the buffer if possible. More...
 
void micros_keyboard_wait_for_key_press (micros_keyboard_scan_ascii_pair *scan_ascii_pair)
 Retrieves pressed key from the buffer (or waits if buffer is empty) More...
 
bool micros_keyboard_get_key_state (micros_keyboard_keys scancode)
 Retrieves key state (is pressed or not) More...
 

Function Documentation

◆ micros_keyboard_get_key_state()

bool micros_keyboard_get_key_state ( micros_keyboard_keys  scancode)

Retrieves key state (is pressed or not)

Retrieves key state (is pressed or not) and returns boolean.

Parameters
scancodeStructure with the key data to check.
Returns
True if the key with the specified scancode is pressed, otherwise false.

◆ micros_keyboard_get_pressed_key()

bool micros_keyboard_get_pressed_key ( micros_keyboard_scan_ascii_pair scan_ascii_pair)

Retrieves pressed key from the buffer if possible.

Retrieves pressed key from the buffer if possible and fill passed struture with data about it.

Parameters
scan_ascii_pairStructure which will be filled with data about it.
Returns
True if key was available in the buffer and structure was filled, otherwise false.

◆ micros_keyboard_is_key_pressed()

bool micros_keyboard_is_key_pressed ( )

Checks if any key is pressed.

Checks if any key is pressed and returns flag.

Returns
True if some key is pressed and is ready to retrieve, otherwise false.

◆ micros_keyboard_wait_for_key_press()

void micros_keyboard_wait_for_key_press ( micros_keyboard_scan_ascii_pair scan_ascii_pair)

Retrieves pressed key from the buffer (or waits if buffer is empty)

Retrieves pressed key from the buffer (or waits if buffer is empty) and fill passed struture with data about it.

Parameters
scan_ascii_pairStructure which will be filled with data about it.