KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
Device Status

Types relating to overall keyboard state More...

Topics

 Key States
 States each key can be in.
 
 LEDs
 Types associated with keyboard LEDs
 
 Modifier Keys
 Types associated with keyboard modifier keys
 

Data Structures

struct  kbd_cond_t
 Keyboard raw condition structure. More...
 
struct  kbd_state_t
 Keyboard status structure. More...
 

Macros

#define MAX_PRESSED_KEYS   6
 Maximum number of keys the DC can read simultaneously.
 
#define KBD_MAX_KEYS   256
 Maximum number of keys a DC keyboard can have.
 

Typedefs

typedef enum __packed kbd_key kbd_key_t
 Raw Keyboard Key Identifiers.
 
typedef void kbd_keymap_t("Please open an issue, there should be no reason for external code to have used this.")
 

Enumerations

enum  kbd_region_t {
  KBD_REGION_JP = 1 , KBD_REGION_US = 2 , KBD_REGION_UK = 3 , KBD_REGION_DE = 4 ,
  KBD_REGION_FR = 5 , KBD_REGION_IT = 6 , KBD_REGION_ES = 7
}
 Region Codes for the Dreamcast keyboard. More...
 

Functions

char kbd_key_to_ascii (kbd_key_t key, kbd_region_t region, kbd_mods_t mods, kbd_leds_t leds)
 Converts a kbd_key_t value into its corresponding ASCII value.
 
static const int MAX_KBD_KEYS ("Please use KBD_MAX_KEYS.")
 

Variables

enum __packed kbd_key
 Raw Keyboard Key Identifiers.
 

Detailed Description

Types relating to overall keyboard state

Types and API functions revolving around individual constituents of the overall keyboard state. These values can either be retrieved manually with State Polling.

Macro Definition Documentation

◆ KBD_MAX_KEYS

#define KBD_MAX_KEYS   256

Maximum number of keys a DC keyboard can have.

This is a hardware constant. The define prevents the magic number '256' from appearing.

◆ MAX_PRESSED_KEYS

#define MAX_PRESSED_KEYS   6

Maximum number of keys the DC can read simultaneously.

This is a hardware constant. The define prevents the magic number '6' from appearing.

Typedef Documentation

◆ kbd_key_t

typedef enum __packed kbd_key kbd_key_t

Raw Keyboard Key Identifiers.

This is the list of keys that are on the keyboard that may be pressed. The keyboard returns keys in this format.

Note
These are the raw keycodes returned by the US keyboard, and thus only cover the keys on US keyboards (even though they can be used with other keyboards).

◆ kbd_keymap_t

typedef void kbd_keymap_t("Please open an issue, there should be no reason for external code to have used this.")

Enumeration Type Documentation

◆ kbd_region_t

Region Codes for the Dreamcast keyboard.

This is the list of possible values for kbd_state_t::region.

Enumerator
KBD_REGION_JP 

Japanese keyboard.

KBD_REGION_US 

US keyboard.

KBD_REGION_UK 

UK keyboard.

KBD_REGION_DE 

German keyboard.

KBD_REGION_FR 

French keyboard.

KBD_REGION_IT 

Italian keyboard (not supported yet)

KBD_REGION_ES 

Spanish keyboard.

Function Documentation

◆ kbd_key_to_ascii()

char kbd_key_to_ascii ( kbd_key_t key,
kbd_region_t region,
kbd_mods_t mods,
kbd_leds_t leds )

Converts a kbd_key_t value into its corresponding ASCII value.

This function attempts to convert key to its ASCII representation using an internal translation table and additional keyboard state context. To note, this is actually ISO-8859-15 where applicable for non-English regions.

Parameters
keyThe raw key type to convert to ASCII.
regionThe region type of the keyboard containing the key.
modsThe modifier flags impacting the key.
ledsThe LED state flags impacting the key.
Returns
The ASCII value corresponding to key or NULL if the translation was unsuccessful.

◆ MAX_KBD_KEYS()

static const int MAX_KBD_KEYS ( "Please use KBD_MAX_KEYS." )
static

Variable Documentation

◆ kbd_key

enum __packed kbd_key

Raw Keyboard Key Identifiers.

This is the list of keys that are on the keyboard that may be pressed. The keyboard returns keys in this format.

Note
These are the raw keycodes returned by the US keyboard, and thus only cover the keys on US keyboards (even though they can be used with other keyboards).