StuBS
KeyDecoder Class Reference

Decoder for keyboard codes received from the PS2Controller. More...

#include <machine/keydecoder.h>

Collaboration diagram for KeyDecoder:
[legend]

Public Member Functions

 KeyDecoder ()
 Default constructor.
 
Key decode (unsigned char code)
 Interprets the make and break codes received from the keyboard and derives the corresponding scan code and further information about other pressed keys, such as shift and ctrl.
 

Public Attributes

bool status [Key::Scancode::KEYS]
 Current state (pressed or released) of all keys.
 

Private Attributes

unsigned char prefix
 Prefix byte for keys.
 
Key modifier
 activated modifier keys (e.g., caps lock)
 

Detailed Description

Decoder for keyboard codes received from the PS2Controller.

Extracts the make and break codes, modifier and scan codes from the pressed key.

Constructor & Destructor Documentation

◆ KeyDecoder()

KeyDecoder::KeyDecoder ( )
inline

Default constructor.

Member Function Documentation

◆ decode()

Key KeyDecoder::decode ( unsigned char  code)

Interprets the make and break codes received from the keyboard and derives the corresponding scan code and further information about other pressed keys, such as shift and ctrl.

Parameters
codeByte from Keyboard to decode
Returns
Pressed key (Key::valid returns false if the key is not yet complete)

Member Data Documentation

◆ prefix

unsigned char KeyDecoder::prefix
private

Prefix byte for keys.

◆ modifier

Key KeyDecoder::modifier
private

activated modifier keys (e.g., caps lock)

◆ status

bool KeyDecoder::status[Key::Scancode::KEYS]

Current state (pressed or released) of all keys.


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