shortcut: added keyboard shortcut 65/36265/6
authorsungmin ha <sungmin82.ha@samsung.com>
Wed, 4 Mar 2015 10:19:28 +0000 (19:19 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 6 Mar 2015 08:06:58 +0000 (00:06 -0800)
The key sequence of shortcut can be changed from layout.xml.
The shortcut info table is added in the detailed info popup menu.
The shortcuts are comprehensive of popup menu, hwkey and controller.

Change-Id: I34e640d53ed9950611ba388b203d2e57dff613b8
Signed-off-by: sungmin ha <sungmin82.ha@samsung.com>
18 files changed:
tizen/src/display/xmllayoutparser.cpp
tizen/src/ui/Makefile.objs
tizen/src/ui/dockingconview.cpp
tizen/src/ui/dockingconview.h
tizen/src/ui/floatingconview.cpp
tizen/src/ui/floatingconview.h
tizen/src/ui/hardwarekey.cpp
tizen/src/ui/hardwarekey.h
tizen/src/ui/keyboardshortcut.cpp [new file with mode: 0644]
tizen/src/ui/keyboardshortcut.h [new file with mode: 0644]
tizen/src/ui/mainwindow.cpp
tizen/src/ui/mainwindow.h
tizen/src/ui/menu/contextmenu.cpp
tizen/src/ui/menu/contextmenu.h
tizen/src/ui/menu/detailedinfodialog.cpp
tizen/src/ui/menu/detailedinfodialog.h
tizen/src/ui/resource/mobile-720x1280-3btn/layout.xml
tizen/src/ui/resource/wearable-320x320-1btn/layout.xml

index c74ffee..f0b9fdd 100644 (file)
@@ -104,6 +104,7 @@ HardwareKey *XmlLayoutParser::parseKey(QXmlStreamReader &xml)
     QRect keyRegion;
     int keycode = 0;
     QString keyTooptip;
+    QString keySequence;
 
     /* attribute */
     QString keyName = xml.attributes().value(NAME_ATTR_KEYWORD).toString();
@@ -123,13 +124,16 @@ HardwareKey *XmlLayoutParser::parseKey(QXmlStreamReader &xml)
             } else if (xml.name() == "tooltip") {
                 /* tooltip */
                 keyTooptip = xml.readElementText();
+            } else if (xml.name() == "shortcut") {
+                /* shortcut */
+                keySequence = xml.readElementText();
             }
         }
 
         token = xml.readNext();
     }
 
-    return new HardwareKey(keyName, keycode, keyRegion, keyTooptip);
+    return new HardwareKey(keyName, keycode, keyRegion, keyTooptip, keySequence);
 }
 
 int XmlLayoutParser::parseKeyList(
index 66a1398..a798bd3 100644 (file)
@@ -20,6 +20,7 @@ obj-$(CONFIG_QT) += skinkeyitem.o moc_skinkeyitem.o
 obj-$(CONFIG_QT) += displaytype.o
 obj-$(CONFIG_QT) += mainform.o
 obj-$(CONFIG_QT) += keyboardhelper.o
+obj-$(CONFIG_QT) += keyboardshortcut.o moc_keyboardshortcut.o
 obj-$(CONFIG_QT) += skinview.o
 obj-$(CONFIG_QT) += uiinformation.o
 obj-$(CONFIG_QT) += uistate.o
@@ -46,3 +47,6 @@ $(obj)/moc_mainwindow.cpp: $(obj)/mainwindow.h
 $(obj)/moc_skinkeyitem.o: $(obj)/moc_skinkeyitem.cpp
 $(obj)/moc_skinkeyitem.cpp: $(obj)/skinkeyitem.h
        moc $< -o $@
+$(obj)/moc_keyboardshortcut.o: $(obj)/moc_keyboardshortcut.cpp
+$(obj)/moc_keyboardshortcut.cpp: $(obj)/keyboardshortcut.h
+       moc $< -o $@
index a6bfb63..469a11b 100644 (file)
@@ -57,7 +57,7 @@ void DockingConView::createItems(ControllerForm *conForm)
     scene()->addItem(bezelItem);
 
     /* HW keys */
-    QList<HardwareKey *> keyList = conForm->keyList;
+    keyList = conForm->keyList;
 
     HardwareKey *hwKey = NULL;
     for (int i = 0; i < keyList.count(); i++) {
@@ -140,6 +140,11 @@ void DockingConView::mouseMoveEvent(QMouseEvent *event)
     }
 }
 
+QList<HardwareKey *> DockingConView::getKeyList()
+{
+    return keyList;
+}
+
 DockingConView::~DockingConView()
 {
     qDebug("destroy docking controller view");
index 691400d..9579b46 100644 (file)
@@ -43,6 +43,7 @@ class DockingConView : public QGraphicsView
 public:
     DockingConView(ControllerForm *conForm, QGraphicsScene *scene, QWidget *parent = 0);
     ~DockingConView();
+    QList<HardwareKey *> getKeyList();
 
 protected:
     void resizeEvent(QResizeEvent *event);
@@ -60,6 +61,7 @@ private:
     DockingController *parent;
     SkinBezelItem *bezelItem;
     QRubberBand *rubberBand;
+    QList<HardwareKey *> keyList;
 };
 
 #endif // DOCKINGCONVIEW_H
index a6572dc..c65f690 100644 (file)
@@ -59,7 +59,7 @@ void FloatingConView::createItems(ControllerForm *conForm)
     scene()->addItem(bezelItem);
 
     /* HW keys */
-    QList<HardwareKey *> keyList = conForm->keyList;
+    keyList = conForm->keyList;
 
     HardwareKey *hwKey = NULL;
     for (int i = 0; i < keyList.count(); i++) {
@@ -217,6 +217,11 @@ void FloatingConView::mouseMoveEvent(QMouseEvent *event)
     }
 }
 
+QList<HardwareKey *> FloatingConView::getKeyList()
+{
+    return keyList;
+}
+
 FloatingConView::~FloatingConView()
 {
     qDebug("destroy floating controller view");
index f2e996f..164e964 100644 (file)
@@ -43,6 +43,7 @@ class FloatingConView : public QGraphicsView
 public:
     FloatingConView(ControllerForm *conForm, QGraphicsScene *scene, QWidget *parent = 0);
     ~FloatingConView();
+    QList<HardwareKey *> getKeyList();
 
 protected:
     void resizeEvent(QResizeEvent *event);
@@ -61,6 +62,7 @@ private:
     FloatingController *parent;
     SkinBezelItem *bezelItem;
     QRubberBand *rubberBand;
+    QList<HardwareKey *> keyList;
 };
 
 #endif // FLOATINGCONVIEW_H
index 336f277..e525d36 100644 (file)
 
 #include "hardwarekey.h"
 
-HardwareKey::HardwareKey(QString name, int keycode, QRect region, QString tooltip)
+HardwareKey::HardwareKey(QString name, int keycode, QRect region, QString tooltip, QString keySequence)
 {
     this->name = name;
     this->keycode = keycode;
     this->region = region;
     this->tooltip = tooltip;
+    this->keySequence = keySequence;
 }
 
 HardwareKey::~HardwareKey()
index 6fabe42..4b85f75 100644 (file)
 class HardwareKey
 {
 public:
-    HardwareKey(QString name, int keycode, QRect region, QString tooltip);
+    HardwareKey(QString name, int keycode, QRect region, QString tooltip, QString keySequence);
     ~HardwareKey();
 
     QString name;
     int keycode;
     QRect region;
     QString tooltip;
+    QString keySequence;
 };
 
 #endif // HARDWAREKEY_H
diff --git a/tizen/src/ui/keyboardshortcut.cpp b/tizen/src/ui/keyboardshortcut.cpp
new file mode 100644 (file)
index 0000000..a730b50
--- /dev/null
@@ -0,0 +1,446 @@
+/*
+ * Qt UI
+ *
+ * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * Sangho Park <sangho1206.park@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#include "keyboardshortcut.h"
+#include "mainwindow.h"
+
+KeyboardShortcut::KeyboardShortcut(QWidget *parent) : QWidget(parent)
+{
+    this->parent = (MainWindow *)parent;
+}
+
+void KeyboardShortcut::removeControllerShortcut()
+{
+    for (int index = 0; index < controllerShortcutList.count(); index++) {
+        delete controllerShortcutList.at(index);
+    }
+
+    controllerShortcutList.clear();
+    controllerShortcutMap.clear();
+
+    qDebug() << "Removed controller shortcuts";
+}
+
+void KeyboardShortcut::removeHwKeyShortcut()
+{
+    for (int index = 0; index < hwKeyShortcutList.count(); index++) {
+        delete hwKeyShortcutList.at(index);
+    }
+
+    hwKeyShortcutList.clear();
+    hwKeyShortcutMap.clear();
+
+    qDebug() << "Removed hwKey shortcuts";
+}
+
+void KeyboardShortcut::registShortcutKey(QShortcut *shortcut, QString item)
+{
+    QSignalMapper *mapper = new QSignalMapper(this);
+    if (!mapper || !shortcut) {
+        qDebug() << "regist HwKey shortcut failed.";
+        return;
+    }
+
+    connect(shortcut, SIGNAL(activated()), mapper, SLOT(map()));
+    mapper->setMapping(shortcut, item);
+    connect(mapper, SIGNAL(mapped(const QString &)), this, SLOT(slotShortcutHwKey(const QString &)));
+}
+
+void KeyboardShortcut::setKeyboardShortcutController()
+{
+    DockingController *dct = parent->getDockingCon();
+    FloatingController *fct = parent->getFloatingCon();
+
+    if (dct) {
+        controllerKeyList = dct->getConView()->getKeyList();
+    } else if (fct) {
+        controllerKeyList = fct->getConView()->getKeyList();
+    } else {
+        qDebug() << "controllerKeyList is not exist!";
+        return;
+    }
+
+    qDebug() << "Set keyboard shortcut ControllerKeys.";
+    for (int index = 0; index < controllerKeyList.count(); index++) {
+        HardwareKey *controllerKey = controllerKeyList.at(index);
+        if (controllerKey) {
+            if (!controllerKey->keySequence.isEmpty()) {
+                QShortcut *shortcut = new QShortcut(QKeySequence::fromString(controllerKey->keySequence), parent);
+                registShortcutKey(shortcut, controllerKey->name);
+
+                controllerShortcutList.append(shortcut);
+                controllerShortcutMap.insert(controllerKey->name, controllerKey->keySequence);
+            }
+        } else {
+            qDebug() << "controllerKeyList.at(" << index << ") is NULL";
+        }
+    }
+}
+
+void KeyboardShortcut::setKeyboardShortcutHwKey()
+{
+    UIInformation *uiInfo = parent->uiInfo;
+
+    if (uiInfo) {
+        if (uiInfo->getMainForm() != NULL) {
+            if (uiInfo->getMainForm()->keyList.count() > 0) {
+                hwKeyList = uiInfo->getMainForm()->keyList;
+            } else if (uiInfo->getMainForm()->keyList.count() == 0) {
+                qDebug() << "hwKey is not exist";
+                return;
+            } else {
+                qDebug() << "hwKeyList is not exist";
+                return;
+            }
+        } else {
+            qDebug() << "uiInfo->getMainForm() is NULL";
+        }
+    } else {
+        qDebug() << "uiInfo is NULL";
+        return;
+    }
+
+    qDebug() << "Set keyboard shortcut HwKeys.";
+    for (int index = 0; index < hwKeyList.count(); index++) {
+        HardwareKey *hwKey = hwKeyList.at(index);
+        if (hwKey) {
+            if (!hwKey->keySequence.isEmpty()) {
+                QShortcut *shortcut = new QShortcut(QKeySequence::fromString(hwKey->keySequence), parent);
+                registShortcutKey(shortcut, hwKey->name);
+
+                hwKeyShortcutList.append(shortcut);
+                hwKeyShortcutMap.insert(hwKey->name, hwKey->keySequence);
+            }
+        } else {
+            qDebug() << "hwKeyList.at(" << index << ") is NULL";
+        }
+    }
+}
+
+void KeyboardShortcut::setKeyboardShortcutContextMenu(MenuItem *item, QString property, QString keySequence)
+{
+    QShortcut *shortcut = new QShortcut(QKeySequence::fromString(keySequence), parent);
+    int itemType = item->getType();
+    QString itemName = item->getName();
+
+    switch (itemType) {
+        case MenuItemType::closeItem:
+            connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutClose()));
+            break;
+        case MenuItemType::infoItem:
+            connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutDetailedInfo()));
+            if (itemName.isEmpty()) {
+                itemName = DETAILED_INFO_TITLE;
+            }
+            break;
+        case MenuItemType::onTopItem:
+            connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutTopMost()));
+            break;
+        case MenuItemType::hostKeyboardItem:
+            connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutHostKeyboard()));
+            break;
+        case MenuItemType::forceCloseItem:
+            connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutForceClose()));
+            break;
+        case MenuItemType::shellItem:
+            connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutShell()));
+            break;
+        case MenuItemType::controlPanelItem:
+            connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutControlPanel()));
+            break;
+        case MenuItemType::screenShotItem:
+            connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutRequestScreenshot()));
+            break;
+        case MenuItemType::controllerItem:
+            connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutController()));
+            break;
+        case MenuItemType::scaleItem:
+            if (property == "prev") {
+                connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutScalePrev()));
+            } else if (property == "next") {
+                connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutScaleNext()));
+            } else {
+                qDebug() << "undefined property: " << property;
+            }
+            break;
+        case MenuItemType::switchItem:
+            if (property == "prev") {
+                connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutSwitchPrev()));
+            } else if (property == "next") {
+                connect(shortcut, SIGNAL(activated()), this, SLOT(slotShortcutSwitchNext()));
+            } else {
+                qDebug() << "undefined property: " << property;
+            }
+            break;
+        default:
+            qDebug() << "undefined item type: " << itemType;
+            return;
+    }
+
+    if (!property.isEmpty()) {
+        itemName.append(" " + property);
+    }
+
+    popupMenuShortcutMap.insert(itemName, keySequence);
+}
+
+void KeyboardShortcut::slotShortcutClose()
+{
+    parent->getPopupMenu()->slotClose();
+}
+
+void KeyboardShortcut::slotShortcutDetailedInfo()
+{
+    parent->getPopupMenu()->slotDetailedInfo();
+}
+
+void KeyboardShortcut::slotShortcutShell()
+{
+    parent->getPopupMenu()->slotShell();
+}
+
+void KeyboardShortcut::slotShortcutRequestScreenshot()
+{
+    parent->getPopupMenu()->slotRequestScreenshot();
+}
+
+void KeyboardShortcut::slotShortcutForceClose()
+{
+    parent->getPopupMenu()->slotForceClose();
+}
+
+void KeyboardShortcut::slotShortcutControlPanel()
+{
+    parent->getPopupMenu()->slotControlPanel();
+}
+
+void KeyboardShortcut::slotShortcutTopMost()
+{
+    QAction *action = parent->getPopupMenu()->getActionTopMost();
+    parent->getPopupMenu()->slotTopMost(!action->isChecked());
+}
+
+void KeyboardShortcut::slotShortcutSwitchPrev()
+{
+    QAction *action = parent->getPopupMenu()->switchGroup->checkedAction();
+    QList<QAction *> switchList = parent->getPopupMenu()->switchGroup->actions();
+
+    if (!action) {
+        qDebug() << "switch prev failed.";
+        return;
+    }
+
+    int index = switchList.indexOf(action);
+    if (index == switchList.count() - 1) {
+        index = 0;
+    } else {
+        index++;
+    }
+
+    QAction *nextSwitchAction = switchList.at(index);
+    nextSwitchAction->setChecked(true);
+    nextSwitchAction->trigger();
+}
+
+void KeyboardShortcut::slotShortcutSwitchNext()
+{
+    QAction *action = parent->getPopupMenu()->switchGroup->checkedAction();
+    QList<QAction *> switchList = parent->getPopupMenu()->switchGroup->actions();
+
+    if (!action) {
+        qDebug() << "switch next failed.";
+        return;
+    }
+
+    int index = switchList.indexOf(action);
+    if (index == 0) {
+        index = switchList.count() - 1;
+    } else {
+        index--;
+    }
+
+    QAction *nextSwitchAction = switchList.at(index);
+    nextSwitchAction->setChecked(true);
+    nextSwitchAction->trigger();
+}
+
+void KeyboardShortcut::slotShortcutScaleNext()
+{
+    QAction *action = parent->getPopupMenu()->scaleGroup->checkedAction();
+    QList<QAction *> scaleList = parent->getPopupMenu()->scaleGroup->actions();
+
+    if (!action) {
+        qDebug() << "scale next failed.";
+        return;
+    }
+
+    int index = scaleList.indexOf(action);
+    if (index == 0) {
+        index = scaleList.count() - 1;
+    } else {
+        index--;
+    }
+
+    QAction *nextScaleAction = scaleList.at(index);
+    nextScaleAction->setChecked(true);
+    nextScaleAction->trigger();
+}
+
+void KeyboardShortcut::slotShortcutScalePrev()
+{
+    QAction *action = parent->getPopupMenu()->scaleGroup->checkedAction();
+    QList<QAction *> scaleList = parent->getPopupMenu()->scaleGroup->actions();
+
+    if (!action) {
+        qDebug() << "scale prev failed.";
+        return;
+    }
+
+    int index = scaleList.indexOf(action);
+    if (index == scaleList.count() - 1) {
+        index = 0;
+    } else {
+        index++;
+    }
+
+    QAction *nextScaleAction = scaleList.at(index);
+    nextScaleAction->setChecked(true);
+    nextScaleAction->trigger();
+}
+
+void KeyboardShortcut::slotShortcutController()
+{
+    QAction *action = parent->getPopupMenu()->controllerGroup->checkedAction();
+    QList<QAction *> controllerList = parent->getPopupMenu()->controllerGroup->actions();
+
+    if (!action) {
+        qDebug() << "change controller failed.";
+        return;
+    }
+
+    int last_index = controllerList.count() - 1;
+    int index = controllerList.indexOf(action) + 1;
+
+    if (index > last_index) {
+        index = 0;
+    }
+
+    QAction *nextControllerAction = controllerList.at(index);
+    if (!nextControllerAction) {
+        qDebug() << "controllerList.at(" << index << ") is NULL";
+        return;
+    }
+
+    nextControllerAction->setChecked(true);
+    nextControllerAction->trigger();
+}
+
+void KeyboardShortcut::slotShortcutHostKeyboard()
+{
+    QAction *action = parent->getPopupMenu()->keyboardGroup->checkedAction();
+    QList<QAction *> keyboardStatusList = parent->getPopupMenu()->keyboardGroup->actions();
+
+    if (!action) {
+        qDebug() << "HostKeyboard enable/disable failed";
+        return;
+    }
+
+    int index = 0;
+    if (action->text().contains(KEYBOARD_ON)) {
+        for (index = 0; index < keyboardStatusList.count(); index++) {
+            if (keyboardStatusList.at(index)->text().contains(KEYBOARD_OFF)) {
+                break;
+            }
+        }
+    } else {
+        for (index = 0; index < keyboardStatusList.count(); index++) {
+            if (keyboardStatusList.at(index)->text().contains(KEYBOARD_ON)) {
+                break;
+            }
+        }
+    }
+
+    keyboardStatusList.at(index)->setChecked(true);
+}
+
+int KeyboardShortcut::getHwKeyCode(const char *item)
+{
+    int index = 0, keyCode = 0;
+
+    for (index = 0; index < hwKeyList.count(); index++) {
+        if (strcmp(hwKeyList.at(index)->name.toLocal8Bit().data(), item) == 0) {
+            keyCode = hwKeyList.at(index)->keycode;
+            break;
+        }
+    }
+
+    if (index == hwKeyList.count()) {
+        qDebug() << item << "is not exist in KeyList";
+    }
+
+    return keyCode;
+}
+
+void KeyboardShortcut::doHwKeyEvent(int keyCode)
+{
+    do_hw_key_event(KEY_PRESSED, keyCode);
+    do_hw_key_event(KEY_RELEASED, keyCode);
+}
+
+void KeyboardShortcut::slotShortcutHwKey(const QString &name)
+{
+    int keyCode = getHwKeyCode(name.toLocal8Bit().data());
+    doHwKeyEvent(keyCode);
+}
+
+QList<QShortcut *> KeyboardShortcut::getControllerShortcutList()
+{
+    return controllerShortcutList;
+}
+
+QMap<QString, QString> KeyboardShortcut::getPopupMenuShortcutMap()
+{
+    return popupMenuShortcutMap;
+}
+
+QMap<QString, QString> KeyboardShortcut::getHwKeyShortcutMap()
+{
+    return hwKeyShortcutMap;
+}
+
+QMap<QString, QString> KeyboardShortcut::getControllerShortcutMap()
+{
+    return controllerShortcutMap;
+}
+
+KeyboardShortcut::~KeyboardShortcut()
+{
+    qDebug("destroy keyboard shortcut");
+}
diff --git a/tizen/src/ui/keyboardshortcut.h b/tizen/src/ui/keyboardshortcut.h
new file mode 100644 (file)
index 0000000..6ee5a45
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Qt UI
+ *
+ * Copyright (C) 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Sungmin Ha <sungmin82.ha@samsung.com>
+ * GiWoong Kim <giwoong.kim@samsung.com>
+ * Sangho Park <sangho1206.park@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+#ifndef KEYBOARDSHORTCUT_H
+#define KEYBOARDSHORTCUT_H
+
+#include <QObject>
+#include <QShortcut>
+#include <QMap>
+
+#include "hardwarekey.h"
+#include "menu/menuitem.h"
+
+class MainWindow;
+
+class KeyboardShortcut : public QWidget
+{
+    Q_OBJECT
+
+public:
+    KeyboardShortcut(QWidget *parent = 0);
+    ~KeyboardShortcut();
+
+    void setKeyboardShortcutHwKey();
+    void setKeyboardShortcutController();
+    void setKeyboardShortcutContextMenu(MenuItem *item, QString property, QString keySequence);
+    void removeControllerShortcut();
+    void removeHwKeyShortcut();
+
+    QList<QShortcut *> getControllerShortcutList();
+    QMap<QString, QString> getPopupMenuShortcutMap();
+    QMap<QString, QString> getHwKeyShortcutMap();
+    QMap<QString, QString> getControllerShortcutMap();
+
+public slots:
+    void slotShortcutHwKey(const QString &name);
+    void slotShortcutClose();
+    void slotShortcutDetailedInfo();
+    void slotShortcutControlPanel();
+    void slotShortcutShell();
+    void slotShortcutRequestScreenshot();
+    void slotShortcutForceClose();
+    void slotShortcutHostKeyboard();
+    void slotShortcutController();
+    void slotShortcutScalePrev();
+    void slotShortcutScaleNext();
+    void slotShortcutSwitchPrev();
+    void slotShortcutSwitchNext();
+    void slotShortcutTopMost();
+
+private:
+    void registShortcutKey(QShortcut *shortcut, QString item);
+    int getHwKeyCode(const char *item);
+    void doHwKeyEvent(int keyCode);
+
+    MainWindow *parent;
+    QList<HardwareKey *> hwKeyList;
+    QList<HardwareKey *> controllerKeyList;
+    QList<QShortcut *> controllerShortcutList;
+    QList<QShortcut *> hwKeyShortcutList;
+    QMap<QString, QString> popupMenuShortcutMap;
+    QMap<QString, QString> hwKeyShortcutMap;
+    QMap<QString, QString> controllerShortcutMap;
+};
+
+#endif // KEYBOARDSHORTCUT_H
index c5191e2..ddc2988 100644 (file)
@@ -134,6 +134,10 @@ MainWindow::MainWindow(UIInformation *uiInfo, QWidget *parent)
         screenWidget = w;
     }
 
+    /* set HwKey shortcut */
+    keyboardShortcut = new KeyboardShortcut(this);
+    keyboardShortcut->setKeyboardShortcutHwKey();
+
     /* popup menu */
     popupMenu = new ContextMenu(this);
 
@@ -269,6 +273,9 @@ void MainWindow::openController(int index, int dockPos)
      * So, we need an additional updating for display. */
     display->update();
 
+    /* set controller shortcut */
+    keyboardShortcut->setKeyboardShortcutController();
+
 #ifdef CONFIG_LINUX
     popupMenu->slotTopMost(getUIState()->isOnTop());
 #endif
@@ -300,6 +307,9 @@ void MainWindow::closeController()
     /* Some part of QGLWidget's surface might be lost on Windows when view changing.
      * So, we need an additional updating for display. */
     display->update();
+
+    /* remove controller shortcut */
+    keyboardShortcut->removeControllerShortcut();
 }
 
 void MainWindow::resizeEvent(QResizeEvent *event)
@@ -392,6 +402,11 @@ void MainWindow::setTopMost(bool on)
     popupMenu->slotTopMost(on);
 }
 
+KeyboardShortcut *MainWindow::getKeyboardShortcut()
+{
+    return keyboardShortcut;
+}
+
 MainWindow::~MainWindow()
 {
     qDebug("destory main window");
index 98da3f6..94714c5 100644 (file)
@@ -43,6 +43,7 @@
 #include "uiinformation.h"
 #include "dockingcontroller.h"
 #include "floatingcontroller.h"
+#include "keyboardshortcut.h"
 
 extern "C" {
 #include "skin/maruskin_operation.h"
@@ -75,6 +76,7 @@ public:
 
     UIState *getUIState(void);
     ContextMenu *getPopupMenu();
+    KeyboardShortcut *getKeyboardShortcut();
     QLabel *getScreenWidget();
     void switchForm(int angle);
     void scaleForm(int scale);
@@ -112,6 +114,7 @@ private:
     ContextMenu *popupMenu;
     QThread *swapperThread;
     DisplaySwapper *swapper;
+    KeyboardShortcut *keyboardShortcut;
 
     void (*captureRequestHandler)(void *data);
     void *captureRequestData;
index 0b32324..54df96f 100644 (file)
@@ -70,6 +70,7 @@ ContextMenu::ContextMenu(QWidget *parent) : QMenu(parent)
 void ContextMenu::createItems(QMenu *menu, QList<MenuItem *> &list)
 {
     MenuItem *item = NULL;
+    KeyboardShortcut *keyboardShortcut = parent->getKeyboardShortcut();
 
     for (int i = 0; i < list.count(); i++) {
         item = list.at(i);
@@ -133,6 +134,15 @@ void ContextMenu::createItems(QMenu *menu, QList<MenuItem *> &list)
         default:
             qWarning("unknown menu item type : %d", item->getType());
         }
+
+        QMap<QString, QString> shortcutMap = item->getShortcutMap();
+        if (!shortcutMap.isEmpty()) {
+            QMap<QString, QString>::iterator iter;
+            for (iter = shortcutMap.begin(); iter != shortcutMap.end(); iter++) {
+                keyboardShortcut->setKeyboardShortcutContextMenu(item,
+                                                        iter.key(), iter.value());
+            }
+        }
     }
 }
 
@@ -193,7 +203,7 @@ void ContextMenu::createSwitchItem(QMenu *menu, MenuItem *item)
         QString menuName = item->getName();
         switchMenu = menu->addMenu(
             QIcon(QPixmap(":/icons/rotate.png")), menuName.isEmpty() ? "Switch" : menuName);
-        QActionGroup *switchGroup = new QActionGroup(this);
+        switchGroup = new QActionGroup(this);
         switchMapper = new QSignalMapper(this);
         connect(switchMapper, SIGNAL(mapped(int)), this, SLOT(slotSwitch(int)));
 
@@ -226,7 +236,7 @@ void ContextMenu::createScaleItem(QMenu *menu, MenuItem *item)
         QString menuName = item->getName();
         scaleMenu = menu->addMenu(
             QIcon(QPixmap(":/icons/scale.png")), menuName.isEmpty() ? "Scale" : menuName);
-        QActionGroup *scaleGroup = new QActionGroup(this);
+        scaleGroup = new QActionGroup(this);
         scaleMapper = new QSignalMapper(this);
         connect(scaleMapper, SIGNAL(mapped(int)), this, SLOT(slotScale(int)));
 
@@ -267,7 +277,7 @@ void ContextMenu::createControllerItem(QMenu *menu, MenuItem *item)
     if (conFormList.isEmpty() == false) {
         QString menuName = item->getName();
         controllerMenu = menu->addMenu(menuName.isEmpty() ? "Controller" : menuName);
-        QActionGroup *controllerGroup = new QActionGroup(this);
+        controllerGroup = new QActionGroup(this);
         controllerMapper = new QSignalMapper(this);
         connect(controllerMapper, SIGNAL(mapped(int)), this,
             SLOT(slotController(int)));
@@ -300,14 +310,14 @@ void ContextMenu::createHostKeyboardItem(QMenu *menu, MenuItem *item)
     QString menuName = item->getName();
     QMenu *keyboardMenu = menu->addMenu(QIcon(QPixmap(":/icons/host_keyboard.png")),
         menuName.isEmpty() ? "Host keyboard" : menuName);
-    QActionGroup *keyboardGroup = new QActionGroup(this);
+    keyboardGroup = new QActionGroup(this);
 
-    QAction *action = keyboardMenu->addAction("On");
+    QAction *action = keyboardMenu->addAction(KEYBOARD_ON);
     action->setActionGroup(keyboardGroup);
     action->setCheckable(true);
     connect(action, SIGNAL(toggled(bool)), this, SLOT(slotHostKeyboard(bool)));
 
-    action = keyboardMenu->addAction("Off");
+    action = keyboardMenu->addAction(KEYBOARD_OFF);
     action->setActionGroup(keyboardGroup);
     action->setCheckable(true);
     action->setChecked(true);
@@ -451,6 +461,11 @@ void ContextMenu::slotSwitch(int index)
     qDebug("switch : %d", index);
 
     parent->switchForm(index);
+
+    /* reset HwKey shortcut */
+    KeyboardShortcut *keyboardShortcut = parent->getKeyboardShortcut();
+    keyboardShortcut->removeHwKeyShortcut();
+    keyboardShortcut->setKeyboardShortcutHwKey();
 }
 
 void ContextMenu::slotScale(int scale)
@@ -802,6 +817,11 @@ QSignalMapper *ContextMenu::getControllerMapper()
     return controllerMapper;
 }
 
+QAction *ContextMenu::getActionTopMost()
+{
+    return actionTopMost;
+}
+
 ContextMenu::~ContextMenu()
 {
     qDebug("destroy menu");
index a776b3b..cacc56c 100644 (file)
@@ -38,6 +38,7 @@
 #include "aboutdialog.h"
 #include "screenshotdialog.h"
 #include "menu/menuitem.h"
+#include "keyboardshortcut.h"
 
 class MainWindow;
 
@@ -48,6 +49,8 @@ extern "C" {
 }
 
 #define CLOSE_POWER_KEY_INTERVAL 1200 /* milli-seconds */
+#define KEYBOARD_ON "On"
+#define KEYBOARD_OFF "Off"
 
 class ContextMenu : public QMenu
 {
@@ -61,6 +64,12 @@ public:
     QSignalMapper *getScaleMapper();
     QSignalMapper *getControllerMapper();
 
+    QActionGroup *scaleGroup;
+    QActionGroup *keyboardGroup;
+    QActionGroup *controllerGroup;
+    QActionGroup *switchGroup;
+
+    QAction *getActionTopMost();
     ScreenShotDialog *screenshotDialog;
 
 signals:
index 7c86f0c..ecc7084 100644 (file)
@@ -40,8 +40,9 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) :
 {
     QStringList imagePathList = getImagePathList();
     MainWindow *win = ((MainWindow *)parent);
+    keyboardShortcut = win->getKeyboardShortcut();
 
-    setWindowTitle("Detailed Info");
+    setWindowTitle(DETAILED_INFO_TITLE);
 
     baseLayout = new QVBoxLayout(this);
     baseLayout->setMargin(10);
@@ -52,102 +53,87 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) :
     upsideLayout->setMargin(0);
     upsideLayout->setSpacing(0);
 
+    /* tab */
+    QTabWidget *tabWidget = new QTabWidget(this);
+    QWidget *vmInfo = new QWidget;
+    QWidget *shortcutInfo = new QWidget;
+    tabWidget->addTab(vmInfo, tr("VM Info"));
+    tabWidget->addTab(shortcutInfo, tr("Shortcut Info"));
+
     /* VM information table */
-    infoTable = new QTableWidget(this);
-    infoTable->setRowCount(11);
-    infoTable->setColumnCount(2);
-    infoTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
-    infoTable->setAlternatingRowColors(true);
+    vmInfoTable = new QTableWidget(vmInfo);
+    vmInfoTable->setColumnCount(2);
+    vmInfoTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
+    vmInfoTable->setAlternatingRowColors(true);
 
-    infoTable->verticalHeader()->hide();
-    infoTable->resizeRowsToContents();
-    infoTable->horizontalHeader()->setStretchLastSection(true);
-    infoTable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
+    vmInfoTable->verticalHeader()->hide();
+    vmInfoTable->resizeRowsToContents();
+    vmInfoTable->horizontalHeader()->setStretchLastSection(true);
+    vmInfoTable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
 
     QStringList header;
     header << "Feature" << "Value";
-    infoTable->setHorizontalHeaderLabels(header);
+    vmInfoTable->setHorizontalHeaderLabels(header);
 
     /* table items */
     int index = 0;
-    item = new QTableWidgetItem("VM Name");
-    infoTable->setItem(index, 0, item);
-    item = new QTableWidgetItem(win->uiInfo->vmName);
-    infoTable->setItem(index++, 1, item);
-
-    item = new QTableWidgetItem("Skin Name");
-    infoTable->setItem(index, 0, item);
-    item = new QTableWidgetItem(win->uiInfo->skinName);
-    infoTable->setItem(index++, 1, item);
-
-    item = new QTableWidgetItem("CPU");
-    infoTable->setItem(index, 0, item);
-    item = new QTableWidgetItem("x86");
-    infoTable->setItem(index++, 1, item);
-
-    item = new QTableWidgetItem("Ram Size");
-    infoTable->setItem(index, 0, item);
-    item = new QTableWidgetItem(QString(get_emul_ram_size()) + " MB");
-    infoTable->setItem(index++, 1, item);
-
-    item = new QTableWidgetItem("Display Resolution");
-    infoTable->setItem(index, 0, item);
-    item = new QTableWidgetItem(QString::number(win->uiInfo->resolution.width())
-        + "x" + QString::number(win->uiInfo->resolution.height()));
-    infoTable->setItem(index++, 1, item);
-
+    setDataTable(vmInfoTable, "VM Name", win->uiInfo->vmName, index++);
+    setDataTable(vmInfoTable, "Skin Name", win->uiInfo->skinName, index++);
+    setDataTable(vmInfoTable, "CPU", "x86", index++);
+    setDataTable(vmInfoTable, "Ram Size", QString(get_emul_ram_size()) + " MB", index++);
+    setDataTable(vmInfoTable, "Display Resolution",
+                                        QString::number(win->uiInfo->resolution.width()) + "x" +
+                                        QString::number(win->uiInfo->resolution.height()), index++);
 #if 0
-    item = new QTableWidgetItem("Display Density");
-    infoTable->setItem(index, 0, item);
-    item = new QTableWidgetItem("0"); // TODO:
-    infoTable->setItem(index++, 1, item);
+    setDataTable(vmInfoTable, "Display Density", "0"/* TODO: */, index++);
 #endif
 
-    item = new QTableWidgetItem("File Sharing Path");
-    infoTable->setItem(index, 0, item);
     QString sharingPath(get_emul_file_sharing_path());
-    item = new QTableWidgetItem((sharingPath.isEmpty()) ? "None" : sharingPath);
-    infoTable->setItem(index++, 1, item);
-
-    item = new QTableWidgetItem("CPU Virtualization");
-    infoTable->setItem(index, 0, item);
-    item = new QTableWidgetItem((get_emul_cpu_accel()) ? "Enabled" : "Disabled");
-    infoTable->setItem(index++, 1, item);
-
-    item = new QTableWidgetItem("GPU Virtualization");
-    infoTable->setItem(index, 0, item);
-    item = new QTableWidgetItem((get_emul_gpu_accel()) ? "Enabled" : "Disabled");
-    infoTable->setItem(index++, 1, item);
+    setDataTable(vmInfoTable, "File Sharing Path", (sharingPath.isEmpty()) ? "None" : sharingPath, index++);
+    setDataTable(vmInfoTable, "CPU Virtualization", (get_emul_cpu_accel()) ? "Enabled" : "Disabled", index++);
+    setDataTable(vmInfoTable, "GPU Virtualization", (get_emul_gpu_accel()) ? "Enabled" : "Disabled", index++);
 
     for (int i = 0; i < imagePathList.size(); i++) {
-        item = new QTableWidgetItem("Image Path " + QString::number(i + 1));
-        infoTable->setItem(index, 0, item);
-        item = new QTableWidgetItem(imagePathList[i]);
+        setDataTable(vmInfoTable, "Image Path " + QString::number(i + 1),
+                        imagePathList[i], index++);
+
         item->setToolTip(imagePathList[i]);
-        infoTable->setItem(index++, 1, item);
     }
-    item = new QTableWidgetItem("Log Path");
-    infoTable->setItem(index, 0, item);
-    item = new QTableWidgetItem(get_log_path());
+    setDataTable(vmInfoTable, "Log Path", get_log_path(), index++);
     item->setToolTip(get_log_path());
-    infoTable->setItem(index++, 1, item);
 
     /* temp */
-    item = new QTableWidgetItem("Logging Telnet Port");
-    infoTable->setItem(index, 0, item);
-    item = new QTableWidgetItem(QString::number(get_emul_serial_port()));
-    infoTable->setItem(index++, 1, item);
+    setDataTable(vmInfoTable, "Logging Telnet Port", QString::number(get_emul_serial_port()), index++);
 
     /* add double click event listener */
-    connect(infoTable, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(slotDoubleClicked(int, int)));
+    connect(vmInfoTable, SIGNAL(cellDoubleClicked(int, int)), this, SLOT(slotDoubleClicked(int, int)));
 
-    int tableHeight = infoTable->horizontalHeader()->height();
-    for (int i = 0; i < infoTable->rowCount(); i++) {
-            tableHeight += infoTable->rowHeight(i);
+    int tableHeight = vmInfoTable->horizontalHeader()->height();
+    for (int i = 0; i < vmInfoTable->rowCount(); i++) {
+            tableHeight += vmInfoTable->rowHeight(i);
     }
-    infoTable->setMinimumWidth(200);
-    infoTable->setMinimumHeight(tableHeight + 2/*border*/);
-    upsideLayout->addWidget(infoTable);
+    vmInfoTable->setMinimumWidth(200);
+    vmInfoTable->setMinimumHeight(tableHeight + 2/*border*/);
+
+    /* shortcut info table */
+    shortcutInfoTable = new QTableWidget(shortcutInfo);
+    shortcutInfoTable->setColumnCount(2);
+    shortcutInfoTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
+    shortcutInfoTable->setAlternatingRowColors(true);
+
+    shortcutInfoTable->verticalHeader()->hide();
+    shortcutInfoTable->horizontalHeader()->setStretchLastSection(true);
+    shortcutInfoTable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
+    shortcutInfoTable->setMinimumHeight(tableHeight + 2);
+
+    header.clear();
+    header << "Function" << "Key sequence";
+    shortcutInfoTable->setHorizontalHeaderLabels(header);
+
+    tabWidget->setMinimumWidth(vmInfoTable->width() + 60);
+    tabWidget->setMinimumHeight(vmInfoTable->height() + 30);
+
+    upsideLayout->addWidget(tabWidget);
 
     baseLayout->addLayout(upsideLayout);
 
@@ -163,6 +149,32 @@ DetailedInfoDialog::DetailedInfoDialog(QWidget *parent) :
     baseLayout->addLayout(downsideLayout);
 }
 
+void DetailedInfoDialog::setShortcutInfoTable(QMap<QString, QString> map)
+{
+    int row = shortcutInfoTable->rowCount();
+    QMap<QString, QString>::const_iterator mapIter = map.constBegin();
+    while (mapIter != map.constEnd()) {
+        setDataTable(shortcutInfoTable, mapIter.key(), mapIter.value(), row++);
+        ++mapIter;
+    }
+}
+
+void DetailedInfoDialog::setDataTable(QTableWidget* table, QString key, QString value, int index)
+{
+    table->insertRow(index);
+    item = new QTableWidgetItem(key);
+    table->setItem(index, 0, item);
+    item = new QTableWidgetItem(value);
+    table->setItem(index, 1, item);
+}
+
+void DetailedInfoDialog::removeDataTable(QTableWidget* table, int startIndex, int lastIndex)
+{
+    for (int cnt = startIndex; cnt < lastIndex; cnt++) {
+        table->removeRow(startIndex);
+    }
+}
+
 QStringList DetailedInfoDialog::getImagePathList()
 {
     QStringList imagePathList;
@@ -188,12 +200,12 @@ void DetailedInfoDialog::slotDoubleClicked(int nRow, int nCol)
     if (nCol == 0)
         return;
 
-    item = infoTable->item(nRow, 0);
+    item = vmInfoTable->item(nRow, 0);
     if (item->text().compare("File Sharing Path", Qt::CaseInsensitive) == 0 ||
-            item->text().compare("Image Path", Qt::CaseInsensitive) == 0 ||
+            item->text().startsWith("Image Path") == true ||
             item->text().compare("Log Path", Qt::CaseInsensitive) == 0) {
         /* get path name */
-        item = infoTable->item(nRow, nCol);
+        item = vmInfoTable->item(nRow, nCol);
         if (item->text().compare("None", Qt::CaseInsensitive) == 0 ||
                 item->text().compare("", Qt::CaseInsensitive) == 0) {
             /* ignore this event */
@@ -224,15 +236,32 @@ void DetailedInfoDialog::showEvent(QShowEvent *event)
     QWidget *win = parentWidget();
     move(win->geometry().center().x() - (geometry().size().width() / 2),
         win->geometry().center().y() - (geometry().size().height() / 2));
+
+    /* insert shortcut info */
+    removeDataTable(shortcutInfoTable, 0, shortcutInfoTable->rowCount());
+    setShortcutInfoTable(keyboardShortcut->getPopupMenuShortcutMap());
+    setShortcutInfoTable(keyboardShortcut->getHwKeyShortcutMap());
+    setShortcutInfoTable(keyboardShortcut->getControllerShortcutMap());
+}
+
+QTableWidget *DetailedInfoDialog::getShortcutInfoTable()
+{
+    return shortcutInfoTable;
 }
 
 DetailedInfoDialog::~DetailedInfoDialog()
 {
     qDebug("destroy detailed info dialog");
 
-    for (int i = 0; i < infoTable->rowCount(); i++) {
-        for (int j = 0; j < infoTable->columnCount(); j++) {
-            delete infoTable->item(i, j);
+    for (int i = 0; i < vmInfoTable->rowCount(); i++) {
+        for (int j = 0; j < vmInfoTable->columnCount(); j++) {
+            delete vmInfoTable->item(i, j);
+        }
+    }
+
+    for (int i = 0; i < shortcutInfoTable->rowCount(); i++) {
+        for (int j = 0; j < shortcutInfoTable->columnCount(); j++) {
+            delete shortcutInfoTable->item(i, j);
         }
     }
 }
index d20d299..c63b114 100644 (file)
 #include <QtWidgets>
 #include <QDialog>
 
+#include "keyboardshortcut.h"
+
+#define DETAILED_INFO_TITLE "Detailed Info"
+
 class DetailedInfoDialog : public QDialog
 {
     Q_OBJECT
@@ -41,6 +45,11 @@ public:
     explicit DetailedInfoDialog(QWidget *parent = 0);
     ~DetailedInfoDialog();
 
+    QTableWidget *getShortcutInfoTable();
+    void setShortcutInfoTable(QMap<QString, QString> map);
+    void setDataTable(QTableWidget* table, QString key, QString value, int index);
+    void removeDataTable(QTableWidget* table, int startIndex, int lastIndex);
+
 protected:
     void showEvent(QShowEvent *event);
 
@@ -51,10 +60,12 @@ private:
     QStringList getImagePathList();
     QVBoxLayout *baseLayout;
     QHBoxLayout *upsideLayout;
-    QTableWidget *infoTable;
+    QTableWidget *vmInfoTable;
+    QTableWidget *shortcutInfoTable;
     QTableWidgetItem *item;
     QHBoxLayout *downsideLayout;
     QPushButton *okBtn;
+    KeyboardShortcut* keyboardShortcut;
 };
 
 #endif // DETAILEDINFODIALOG_H
index c882b07..cc5bc01 100644 (file)
                     <region left="210" top="1401" width="84" height="84"/>
                     <keycode>169</keycode>
                     <tooltip>Menu</tooltip>
+                    <shortcut>F2</shortcut>
                 </key>
                 <key name="Home">
                     <region left="390" top="1401" width="84" height="84"/>
                     <keycode>139</keycode>
                     <tooltip>Home</tooltip>
+                    <shortcut>F1</shortcut>
                 </key>
                 <key name="Back">
                     <region left="570" top="1401" width="84" height="84"/>
                     <region left="841" top="1309" width="24" height="96"/>
                     <keycode>116</keycode>
                     <tooltip>Power</tooltip>
+                    <shortcut>F3</shortcut>
                 </key>
                 <key name="Volume +">
                     <region left="841" top="108" width="24" height="96"/>
                     <keycode>115</keycode>
                     <tooltip>Volume +</tooltip>
+                    <shortcut>Ctrl+Num++</shortcut>
                 </key>
                 <key name="Volume -">
                     <region left="841" top="219" width="24" height="96"/>
                     <keycode>114</keycode>
                     <tooltip>Volume -</tooltip>
+                    <shortcut>Ctrl+Num+-</shortcut>
                 </key>
             </keyList>
         </form>
                     <region left="1400" top="570" width="84" height="84"/>
                     <keycode>169</keycode>
                     <tooltip>Menu</tooltip>
+                    <shortcut>F2</shortcut>
                 </key>
                 <key name="Home">
                     <region left="1400" top="392" width="84" height="84"/>
                     <keycode>139</keycode>
                     <tooltip>Home</tooltip>
+                    <shortcut>F1</shortcut>
                 </key>
                 <key name="Back">
                     <region left="1400" top="210" width="84" height="84"/>
                     <region left="1308" top="2" width="96" height="24"/>
                     <keycode>116</keycode>
                     <tooltip>Power</tooltip>
+                    <shortcut>F3</shortcut>
                 </key>
                 <key name="Volume +">
                     <region left="108" top="2" width="96" height="24"/>
                     <keycode>115</keycode>
                     <tooltip>Volume +</tooltip>
+                    <shortcut>Ctrl+Num++</shortcut>
                 </key>
                 <key name="Volume -">
                     <region left="217" top="2" width="96" height="24"/>
                     <keycode>114</keycode>
                     <tooltip>Volume -</tooltip>
+                    <shortcut>Ctrl+Num+-</shortcut>
                 </key>
             </keyList>
         </form>
                     <region left="570" top="30" width="84" height="84"/>
                     <keycode>169</keycode>
                     <tooltip>Menu</tooltip>
+                    <shortcut>F2</shortcut>
                 </key>
                 <key name="Home">
                     <region left="390" top="30" width="84" height="84"/>
                     <keycode>139</keycode>
                     <tooltip>Home</tooltip>
+                    <shortcut>F1</shortcut>
                 </key>
                 <key name="Back">
                     <region left="210" top="30" width="84" height="84"/>
                     <region left="2" top="110" width="24" height="96"/>
                     <keycode>116</keycode>
                     <tooltip>Power</tooltip>
+                    <shortcut>F3</shortcut>
                 </key>
                 <key name="Volume +">
                     <region left="2" top="1310" width="24" height="96"/>
                     <keycode>115</keycode>
                     <tooltip>Volume +</tooltip>
+                    <shortcut>Ctrl+Num++</shortcut>
                 </key>
                 <key name="Volume -">
                     <region left="2" top="1200" width="24" height="96"/>
                     <keycode>114</keycode>
                     <tooltip>Volume -</tooltip>
+                    <shortcut>Ctrl+Num+-</shortcut>
                 </key>
             </keyList>
         </form>
                     <region left="28" top="209" width="84" height="84"/>
                     <keycode>169</keycode>
                     <tooltip>Menu</tooltip>
+                    <shortcut>F2</shortcut>
                 </key>
                 <key name="Home">
                     <region left="28" top="391" width="84" height="84"/>
                     <keycode>139</keycode>
                     <tooltip>Home</tooltip>
+                    <shortcut>F1</shortcut>
                 </key>
                 <key name="Back">
                     <region left="28" top="568" width="84" height="84"/>
                     <region left="109" top="841" width="96" height="24"/>
                     <keycode>116</keycode>
                     <tooltip>Power</tooltip>
+                    <shortcut>F3</shortcut>
                 </key>
                 <key name="Volume +">
                     <region left="1309" top="841" width="96" height="24"/>
                     <keycode>115</keycode>
                     <tooltip>Volume +</tooltip>
+                    <shortcut>Ctrl+Num++</shortcut>
                 </key>
                 <key name="Volume -">
                     <region left="1199" top="841" width="96" height="24"/>
                     <keycode>114</keycode>
                     <tooltip>Volume -</tooltip>
+                    <shortcut>Ctrl+Num+-</shortcut>
                 </key>
             </keyList>
         </form>
             <shortcut>Ctrl+F2</shortcut>
         </onTopItem>
         <switchItem name="Rotate">
-            <shortcut property="prev">Ctrl+Num7</shortcut>
-            <shortcut property="next">Ctrl+Num9</shortcut>
+            <shortcut property="prev">Ctrl+Num+7</shortcut>
+            <shortcut property="next">Ctrl+Num+9</shortcut>
         </switchItem>
         <scaleItem name="Scale">
             <shortcut property="prev">Ctrl+F9</shortcut>
index e813380..9d329dd 100644 (file)
@@ -14,6 +14,7 @@
                     <region left="372" top="116" width="12" height="80"/>
                     <keycode>116</keycode>
                     <tooltip>Power</tooltip>
+                    <shortcut>F3</shortcut>
                 </key>
             </keyList>
         </form>
@@ -29,6 +30,7 @@
                     <region left="116" top="0" width="80" height="12"/>
                     <keycode>116</keycode>
                     <tooltip>Power</tooltip>
+                    <shortcut>F3</shortcut>
                 </key>
             </keyList>
         </form>
@@ -44,6 +46,7 @@
                     <region left="0" top="244" width="12" height="80"/>
                     <keycode>116</keycode>
                     <tooltip>Power</tooltip>
+                    <shortcut>F3</shortcut>
                 </key>
             </keyList>
         </form>
@@ -59,6 +62,7 @@
                     <region left="244" top="372" width="80" height="12"/>
                     <keycode>116</keycode>
                     <tooltip>Power</tooltip>
+                    <shortcut>F3</shortcut>
                 </key>
             </keyList>
         </form>
@@ -73,8 +77,8 @@
             <shortcut>Ctrl+F2</shortcut>
         </onTopItem>
         <switchItem name="Rotate">
-            <shortcut property="prev">Ctrl+Num7</shortcut>
-            <shortcut property="next">Ctrl+Num9</shortcut>
+            <shortcut property="prev">Ctrl+Num+7</shortcut>
+            <shortcut property="next">Ctrl+Num+9</shortcut>
         </switchItem>
         <separator/>
         <advancedItem>