Rose
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
rose::QUERTY Class Reference

A KeyboardPlugin for a QWERTY keyboard. More...

#include <Keyboard.h>

Inheritance diagram for rose::QUERTY:
Inheritance graph
[legend]
Collaboration diagram for rose::QUERTY:
Collaboration graph
[legend]

Public Member Functions

void build (shared_ptr< Keyboard > keyboard, Size keySize, int fontSize, const std::string &fontName) override
 Build the keyboard from the KeyboardSpec and apply any special layout rules. More...
 

Protected Types

enum  KeyboardMode : size_t { LowerCase, UpperCase, Numeric, Symbols }
 Set the state of the keyboard.
 
enum  SymbolState : size_t { None, Symbols1, Symbols2 }
 The state of symbol selection.
 
using KeySpecType = KeySpec< Depth >
 

Protected Member Functions

auto controlKeyData (const KeySpec< Depth > &keyData)
 Decode a KeySpec and Key index into key Button construction information. More...
 
void setKeyboardMode ()
 Encode data gathered from user interaction into a current KeyboardMode. More...
 
void changeKeyboardFace ()
 Change the Key faces to match the current KeyboardMode.
 

Protected Attributes

std::weak_ptr< KeyboardmKeyboard {}
 The parent Keyboard Widget.
 
uint32_t mTempShiftKey {0}
 The temporary shift status.
 
bool mCapsLock {false}
 The state of the caps lock key.
 
SymbolState mSymbolState {SymbolState::None}
 The state of symbol selection.
 
KeyboardMode mKeyboardMode {KeyboardMode::LowerCase}
 Current KeyboardMode.
 
std::shared_ptr< Slot< Button::SignalType > > rxKey {}
 
std::shared_ptr< Slot< Button::SignalType > > rxCtl {}
 
std::shared_ptr< Slot< Button::SignalType > > rxToggle {}
 

Static Protected Attributes

static constexpr size_t Rows = 4
 
static constexpr size_t KeysPerRow = 11
 
static constexpr size_t Depth = 4
 
static const KeyboardSpec< Rows, KeysPerRow, Depth > QWERTYData
 The KeyboardSpec.
 

Detailed Description

A KeyboardPlugin for a QWERTY keyboard.

Member Function Documentation

◆ build()

void rose::QUERTY::build ( shared_ptr< Keyboard keyboard,
Size  keySize,
int  fontSize,
const std::string &  fontName 
)
overridevirtual

Build the keyboard from the KeyboardSpec and apply any special layout rules.

Parameters
keyboardThe Keyboard Widget to build the keyboard in.
charSlotThe slot to receive key press signals on.

Implements rose::KeyboardPlugin.

◆ controlKeyData()

auto rose::QUERTY::controlKeyData ( const KeySpec< Depth > &  keyData)
protected

Decode a KeySpec and Key index into key Button construction information.

Parameters
keyDataThe KeySpec.
keyIdxThe index into the key.
Returns
A std::tuple with the construction information.

◆ setKeyboardMode()

void rose::QUERTY::setKeyboardMode ( )
protected

Encode data gathered from user interaction into a current KeyboardMode.

If the KeyboardMode changes changeKeyboardFace() is called.


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