13 #ifndef MAGICSMOKE_BCSUSB_KBD_H
14 #define MAGICSMOKE_BCSUSB_KBD_H
65 QChar
toChar(
bool ignoremodifier=
false)
const;
95 QString toString()
const;
100 inline static MKey::Modifiers modconv(
unsigned char m){
112 MHidKeyEvent(
unsigned char mod,QByteArray keys):mmod(modconv(mod)),mkeys(keys){reduce();}
122 int lastkeycode()
const{
if(mkeys.size()>0)
return mkeys[mkeys.size()-1];
else return 0;}
125 QDateTime mtime=QDateTime::currentDateTime();
166 bool parseLayout(QString content,QString filename=QString());
171 void setKeyMapping(
unsigned char keycode,
const QList<MKey> &c);
189 QString mfilename,mlname;
190 QMap<unsigned char,QList<MKey>>mkeymap;
KeyType
Definition: bcskeyboard.h:35
Definition: bcskeyboard.h:39
Definition: bcskeyboard.h:98
MKeySequence toKeys(const MHidKeySequence &) const
Definition: bcskeyboard.cpp:132
static QMap< QString, QString > findLayouts()
Definition: bcskeyboard.cpp:153
MKeySequence(const QList< MKey > &l)
Definition: bcskeyboard.h:87
MHidKeySequence & operator=(const MHidKeySequence &)=default
Modifier
Definition: bcskeyboard.h:25
QString layoutFileName() const
returns the full file name of the layout
Definition: bcskeyboard.h:180
Definition: bcskeyboard.h:37
Modifiers modifiers() const
Definition: bcskeyboard.h:64
void resetLayout()
Definition: bcskeyboard.cpp:39
Definition: bcskeyboard.h:36
void clearKeyMapping()
Definition: bcskeyboard.cpp:34
int lastkeycode() const
Definition: bcskeyboard.h:122
Definition: bcskeyboard.h:131
MHidKeyLayout()
loads the base layout only
Definition: bcskeyboard.cpp:18
MHidKeyEvent & operator=(const MHidKeyEvent &)=default
QString layoutCodeName() const
returns the iso code of the layout (base of the file name) or an empty string if this is a custom lay...
Definition: bcskeyboard.cpp:28
bool operator==(const MKey &)
Definition: bcskeyboard.cpp:198
MKey(KeyType t, Modifiers m=None)
Definition: bcskeyboard.h:54
QChar toChar(bool ignoremodifier=false) const
Definition: bcskeyboard.cpp:278
bool isValid() const
returns true if this is a populated layout
Definition: bcskeyboard.h:185
Definition: bcskeyboard.h:22
MHidKeySequence(QList< MHidKeyEvent > &other)
Definition: bcskeyboard.h:135
MKey toUpper() const
Definition: bcskeyboard.h:74
Definition: bcskeyboard.h:40
MHidKeyLayout & operator=(const MHidKeyLayout &)=default
MHidKeyEvent(unsigned char mod, QByteArray keys)
Definition: bcskeyboard.h:112
Definition: bcskeyboard.h:29
Definition: bcskeyboard.h:28
static MKey fromCharName(QString)
returns a key object matching the encoded character name from a layout file
Definition: bcskeyboard.cpp:231
Definition: bcskeyboard.h:43
Definition: bcskeyboard.h:30
Q_DECLARE_FLAGS(Modifiers, Modifier)
Definition: bcskeyboard.h:83
Q_DECLARE_OPERATORS_FOR_FLAGS(MLocalFormat::MoneyFlags)
QString layoutName() const
returns the human readable name of the layout
Definition: bcskeyboard.h:175
Definition: bcskeyboard.h:44
Definition: bcskeyboard.h:41
bool isPrintable(bool ignoremodifier=false) const
Definition: bcskeyboard.cpp:266
QByteArray keycodes() const
Definition: bcskeyboard.h:120
Definition: bcskeyboard.h:145
QDateTime timestamp() const
Definition: bcskeyboard.h:121
Definition: bcskeyboard.h:38
Definition: bcskeyboard.h:42
Definition: bcskeyboard.h:26
MKeySequence & operator=(const QList< MKey > &l)
Definition: bcskeyboard.h:91
QString toString(const MHidKeySequence &) const
Definition: bcskeyboard.cpp:148
bool parseLayout(QString content, QString filename=QString())
Definition: bcskeyboard.cpp:90
bool loadLayout(QString filename)
attempts to load a layout file, normally the name mentioned should not contain a complete path or the...
Definition: bcskeyboard.cpp:65
MHidKeyEvent()
Definition: bcskeyboard.h:111
Definition: bcskeyboard.h:31
MKey & operator=(const MKey &)=default
bool isValid() const
Definition: bcskeyboard.h:62
MHidKeySequence()
Definition: bcskeyboard.h:134
Definition: bcskeyboard.h:27
QString toLayoutDoc() const
Definition: bcskeyboard.cpp:51
MKeySequence()
Definition: bcskeyboard.h:86
QString toCharName() const
returns the encoded character name as used in layout files
Definition: bcskeyboard.cpp:207
MKey toLower() const
Definition: bcskeyboard.h:73
void setKeyMapping(unsigned char keycode, const QList< MKey > &c)
Definition: bcskeyboard.cpp:45
bool operator!=(const MKey &k)
Definition: bcskeyboard.h:60
Definition: bcskeyboard.h:45
qint64 msSinceLastKey() const
Definition: bcskeyboard.cpp:332
MKey::Modifiers modifiers() const
Definition: bcskeyboard.h:119
void setLayoutName(QString l)
Definition: bcskeyboard.h:182
MKey()
Definition: bcskeyboard.h:48