The Pedigree Project 0.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HostedKeyboard Class Reference
+ Inheritance diagram for HostedKeyboard:
+ Collaboration diagram for HostedKeyboard:

Public Member Functions

virtual void initialise ()
 
virtual void setDebugState (bool enableDebugState)
 
virtual bool getDebugState ()
 
virtual char getChar ()
 
virtual char getCharNonBlock ()
 
virtual char getLedState ()
 
virtual void setLedState (char state)
 

Private Member Functions

void blocking (bool enable)
 

Private Attributes

bool m_bDebugState
 True if we're in debug state.
 

Additional Inherited Members

- Public Types inherited from Keyboard
enum  KeyFlags {
  Special = 1ULL << 63 , Ctrl = 1ULL << 62 , Shift = 1ULL << 61 , Alt = 1ULL << 60 ,
  AltGr = 1ULL << 59
}
 
enum  KeyboardLeds {
  ScrollLock = 1 << 0 , NumLock = 1 << 1 , CapsLock = 1 << 2 , Led1 = 1 << 3 ,
  Led2 = 1 << 4 , Led3 = 1 << 5 , Led4 = 1 << 6 , Led5 = 1 << 7
}
 Bit numbers follow the same format as the PS/2 keyboard LED byte. More...
 

Detailed Description

Definition at line 27 of file kernel/machine/hosted/Keyboard.h.

Constructor & Destructor Documentation

◆ HostedKeyboard()

HostedKeyboard::HostedKeyboard ( )

Definition at line 47 of file hosted/Keyboard.cc.

◆ ~HostedKeyboard()

HostedKeyboard::~HostedKeyboard ( )
virtual

Definition at line 56 of file hosted/Keyboard.cc.

Member Function Documentation

◆ blocking()

void HostedKeyboard::blocking ( bool  enable)
private

Definition at line 106 of file hosted/Keyboard.cc.

◆ getChar()

char HostedKeyboard::getChar ( )
virtual

Retrieves a character from the keyboard. Blocking I/O. If DebugState is false this returns zero. If DebugState is true this returns the next character received, or zero if the character is non-ASCII.

Implements Keyboard.

Definition at line 66 of file hosted/Keyboard.cc.

◆ getCharNonBlock()

char HostedKeyboard::getCharNonBlock ( )
virtual

Retrieves a character from the keyboard. Non blocking I/O. If DebugState is false this returns zero. If DebugState is true this returns the next character received, or zero if the character is non-ASCII.

Implements Keyboard.

Definition at line 79 of file hosted/Keyboard.cc.

◆ getDebugState()

bool HostedKeyboard::getDebugState ( )
virtual

Implements Keyboard.

Definition at line 96 of file hosted/Keyboard.cc.

◆ getLedState()

char HostedKeyboard::getLedState ( )
virtual

Gets the current state of the LEDs on the keyboard. A single byte bitmap is returned with flags from KeyboardLeds identifying which LEDs are on or off.

Reimplemented from Keyboard.

Definition at line 100 of file hosted/Keyboard.cc.

◆ initialise()

void HostedKeyboard::initialise ( )
virtual

Initialises the device.

Implements Keyboard.

Definition at line 58 of file hosted/Keyboard.cc.

◆ setDebugState()

void HostedKeyboard::setDebugState ( bool  enableDebugState)
virtual

Selects polling input while the kernel debugger owns the processor.

A debugger trap can interrupt code which owns arbitrary device or IRQ controller locks. Both this setter and getDebugState() must therefore access this mode without taking locks, waiting, allocating, logging, changing interrupt masks, or starting a device protocol. The debugger trap itself prevents ordinary interrupt delivery while this mode is active.

Implements Keyboard.

Definition at line 92 of file hosted/Keyboard.cc.

References m_bDebugState.

◆ setLedState()

void HostedKeyboard::setLedState ( char  state)
virtual

Sets the current state of LEDs on the keyboard. If a keyboard does not have any LEDs this is essentially a no-op.

Reimplemented from Keyboard.

Definition at line 104 of file hosted/Keyboard.cc.

Member Data Documentation

◆ m_bDebugState

bool HostedKeyboard::m_bDebugState
private

True if we're in debug state.

Definition at line 45 of file kernel/machine/hosted/Keyboard.h.

Referenced by setDebugState().


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