26 if(!strcmp(
name,
"lwin"))
return "Left Cmd";
27 if(!strcmp(
name,
"rwin"))
return "Right Cmd";
28 if(!strcmp(
name,
"lalt"))
return "Left Option";
29 if(!strcmp(
name,
"ralt"))
return "Right Option";
30 if(!strcmp(
name,
"prtscn"))
return "F13";
31 if(!strcmp(
name,
"scroll"))
return "F14";
32 if(!strcmp(
name,
"pause"))
return "F15";
33 if(!strcmp(
name,
"ins"))
return "Help";
34 if(!strcmp(
name,
"numlock"))
return "Clear";
35 #elif defined(Q_OS_LINUX)
36 if(!strcmp(
name,
"lwin"))
return "Left Super";
37 if(!strcmp(
name,
"rwin"))
return "Right Super";
44 inline operator bool ()
const {
return name != 0; }
141 inline Key key(
const QString&
name)
const {
Key empty = {0,0,0,0,0,0,0,0,0};
return _keys.value(name, empty); }
145 inline const QHash<QString, Key>&
map()
const {
return _keys; }
146 inline operator const QHash<QString, Key>& ()
const {
return _keys; }
151 inline QString
fromStorage(
const QString& storage) { QHashIterator<QString, Key> i(*
this);
while(i.hasNext()) { i.next();
const char* s = i.value().storageName();
if(s == storage)
return i.value().name; }
return storage; }
static bool isJP(Layout layout)
QStringList byPosition() const
static QString friendlyName(const QString &key, Layout layout=US)
static bool isMouse(Model model)
QString friendlyName(bool os=true) const
static QStringList layoutNames()
QHash< QString, Key > _keys
static Model getModel(const QString &name)
Key key(const QString &name) const
bool contains(const QString &name) const
QString fromStorage(const QString &storage)
Key operator[](const QString &name) const
const char * _storageName
static bool isKeyboard(Model model)
QString strLayout() const
static Layout getLayout(const QString &name)
const QHash< QString, Key > & map() const
static bool isISO(Layout layout)
const char * storageName() const
static bool isPTBR(Layout layout)
static int modelWidth(Model model)
QString toStorage(const QString &name)
static KeyMap fromName(const QString &name)
static int modelHeight(Model model)
const char * _friendlyName
QList< Key > positions() const