openMSX
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
openmsx::Keyboard Class Referencefinal

#include <Keyboard.hh>

Inheritance diagram for openmsx::Keyboard:
Inheritance graph
[legend]
Collaboration diagram for openmsx::Keyboard:
Collaboration graph
[legend]

Public Types

enum class  Matrix {
  MSX , SVI , CVJOY , SEGA ,
  NUM
}
 

Public Member Functions

 Keyboard (MSXMotherBoard &motherBoard, Scheduler &scheduler, CommandController &commandController, EventDistributor &eventDistributor, MSXEventDistributor &msxEventDistributor, StateChangeDistributor &stateChangeDistributor, Matrix matrix, const DeviceConfig &config)
 Constructs a new Keyboard object.
 
 ~Keyboard ()
 
const MsxChar2UnicodegetMsxChar2Unicode () const
 
std::span< const uint8_t, KeyMatrixPosition::NUM_ROWSgetKeys () const
 Returns a pointer to the current KeyBoard matrix.
 
void transferHostKeyMatrix (const Keyboard &source)
 
void setFocus (bool newFocus, EmuTime::param time)
 
template<typename Archive >
void serialize (Archive &ar, unsigned version)
 

Static Public Attributes

static constexpr int MAX_KEYSYM = 0x150
 

Detailed Description

Definition at line 45 of file Keyboard.hh.

Member Enumeration Documentation

◆ Matrix

enum class openmsx::Keyboard::Matrix
strong
Enumerator
MSX 
SVI 
CVJOY 
SEGA 
NUM 

Definition at line 50 of file Keyboard.hh.

Constructor & Destructor Documentation

◆ Keyboard()

openmsx::Keyboard::Keyboard ( MSXMotherBoard motherBoard,
Scheduler scheduler,
CommandController commandController,
EventDistributor eventDistributor,
MSXEventDistributor msxEventDistributor,
StateChangeDistributor stateChangeDistributor,
Matrix  matrix,
const DeviceConfig config 
)

Constructs a new Keyboard object.

Parameters
motherBoardref to the motherBoard
schedulerref to the scheduler
commandControllerref to the command controller
eventDistributorref to the emu event distributor
msxEventDistributorref to the user input event distributor
stateChangeDistributorref to the state change distributor
matrixwhich system's keyboard matrix to use
configref to the device configuration

Definition at line 689 of file Keyboard.cc.

References ranges::fill(), openmsx::MSXEventDistributor::registerEventListener(), openmsx::MSXMotherBoard::registerKeyboard(), and openmsx::StateChangeDistributor::registerListener().

◆ ~Keyboard()

openmsx::Keyboard::~Keyboard ( )

Member Function Documentation

◆ getKeys()

std::span< const uint8_t, KeyMatrixPosition::NUM_ROWS > openmsx::Keyboard::getKeys ( ) const

Returns a pointer to the current KeyBoard matrix.

Definition at line 813 of file Keyboard.cc.

References openmsx::KeyMatrixPosition::NUM_ROWS, and xrange().

Referenced by openmsx::ImGuiKeyboard::paint(), and openmsx::ColecoJoystickIO::peekIO().

◆ getMsxChar2Unicode()

const MsxChar2Unicode & openmsx::Keyboard::getMsxChar2Unicode ( ) const

Definition at line 748 of file Keyboard.cc.

References openmsx::UnicodeKeymap::getMsxChars().

◆ serialize()

template<typename Archive >
void openmsx::Keyboard::serialize ( Archive &  ar,
unsigned  version 
)

◆ setFocus()

void openmsx::Keyboard::setFocus ( bool  newFocus,
EmuTime::param  time 
)

Definition at line 850 of file Keyboard.cc.

◆ transferHostKeyMatrix()

void openmsx::Keyboard::transferHostKeyMatrix ( const Keyboard source)

Definition at line 828 of file Keyboard.cc.

References openmsx::KeyMatrixPosition::NUM_ROWS, and xrange().

Member Data Documentation

◆ MAX_KEYSYM

constexpr int openmsx::Keyboard::MAX_KEYSYM = 0x150
staticconstexpr

Definition at line 49 of file Keyboard.hh.


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