shortcut: release pressed keys before input H/W keycode
authorMunkyu Im <munkyu.im@samsung.com>
Fri, 25 Nov 2016 04:01:31 +0000 (13:01 +0900)
committerMunkyu Im <munkyu.im@samsung.com>
Fri, 25 Nov 2016 05:09:57 +0000 (14:09 +0900)
when user input shortcut key,
the last key sequence is replaced with H/W keycode.
So the key combination on guest is twisted.
Here is an example.
This is key sequence of Menu H/W key: "Crtl + Shift + F6"
If user press "F6",
this key is not delivered to guest but "keycode 169" is delivered.
Finally guest gets "Ctrl + Shift" and "keycode 169".
It occurs unexpected behavior on guest side.

So, if user want to input H/W keycode with shortcut,
all keys pressed should be released before send it.

Change-Id: I82e1310af577d1ab43d20e2f5a9362ba2f58e59c
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
tizen/src/ui/input/keyboardshortcut.cpp

index a5f598c..101d1ff 100644 (file)
@@ -96,7 +96,12 @@ void KeyboardShortcut::cancelHwKeyShortcuts(QList<HardwareKey *> &list)
 void KeyboardShortcut::slotHwKeyShortcut(int keycode)
 {
     qDebug() << "shortcut: \"HW key\"" << keycode;
-
+    MainView *mainView = win->getMainView();
+    if (mainView) {
+        mainView->getKbdHelper()->autoKeyRelease();
+    } else {
+        qWarning() << "mainView is not ready.";
+    }
     do_hw_key_event(KEY_PRESSED, keycode);
     do_hw_key_event(KEY_RELEASED, keycode);
 }