15#include "SubComponent.h"
23class Keyboard final :
public SubComponent {
25 Descriptions descriptions = {{
28 .description =
"Keyboard"
32 u8 kbMatrixRow[8] = { };
33 u8 kbMatrixCol[8] = { };
36 u8 kbMatrixRowCnt[8] = { };
37 u8 kbMatrixColCnt[8] = { };
40 bool shiftLock =
false;
43 util::SortedRingBuffer<Cmd, 1024> pending;
52 Keyboard(C64 &ref) : SubComponent(ref) { }
54 Keyboard& operator= (
const Keyboard& other) {
56 CLONE_ARRAY(kbMatrixRow)
57 CLONE_ARRAY(kbMatrixCol)
58 CLONE_ARRAY(kbMatrixRowCnt)
59 CLONE_ARRAY(kbMatrixColCnt)
74 void serialize(T& worker)
84 } SERIALIZERS(serialize);
93 const Descriptions &getDescriptions()
const override {
return descriptions; }
97 void _dump(Category category, std::ostream& os)
const override;
98 void _reset(
bool hard)
override;
108 u8 getColumnValues(u8 rowMask)
const;
109 u8 getRowValues(u8 columnMask)
const;
110 u8 getRowValues(u8 columnMask, u8 thresholdMask)
const;
113 bool isPressed(C64Key key)
const;
116 void press(C64Key key);
117 void release(C64Key key);
118 void toggle(C64Key key) { isPressed(key) ? release(key) : press(key); }
131 void autoType(
const string &text);
134 void abortAutoTyping();
144 void processCommand(
const Cmd &cmd);
147 void processKeyEvent(EventID
id);
VirtualC64 project namespace.
Definition CmdQueue.cpp:16