summaryrefslogtreecommitdiff
diff options
authorBrandon Schaefer <brandontschaefer@gmail.com>2014-03-19 17:04:14 -0700
committerBrandon Schaefer <brandontschaefer@gmail.com>2014-03-19 17:04:14 -0700
commitb63ae2b0bc27ea09b8f6b2dfafb18d7e6a1fced6 (patch)
tree2114449cb536c81bb28d7e1f2a56756cb9ef3472
parent7d8f3e08475ebe419b1dcf6a684534b82bb0021d (diff)
* Move both key_code conversions to the HandleKeyEvent function
(bzr r3731.2.2)
-rw-r--r--launcher/LauncherController.cpp5
-rw-r--r--launcher/LauncherController.h2
-rw-r--r--plugins/unityshell/src/unityshell.cpp5
3 files changed, 6 insertions, 6 deletions
diff --git a/launcher/LauncherController.cpp b/launcher/LauncherController.cpp
index 6e8d03978..3cf22779d 100644
--- a/launcher/LauncherController.cpp
+++ b/launcher/LauncherController.cpp
@@ -1251,8 +1251,11 @@ void Controller::HandleLauncherKeyRelease(bool was_tap, int when)
}
}
-bool Controller::HandleLauncherKeyEvent(unsigned long key_state, unsigned int key_code, Time timestamp)
+bool Controller::HandleLauncherKeyEvent(unsigned long key_state, unsigned int key_sym, Time timestamp)
{
+ // Turn the key_sym back to a keycode, this turns keypad key_sym to the correct top row key_code
+ unsigned int key_code = XKeysymToKeycode(nux::GetGraphicsDisplay()->GetX11Display(), key_sym);
+
// Shortcut to start launcher icons. Only relies on Keycode, ignore modifier
for (auto const& icon : *pimpl->model_)
{
diff --git a/launcher/LauncherController.h b/launcher/LauncherController.h
index 96b849b1e..305caa0c3 100644
--- a/launcher/LauncherController.h
+++ b/launcher/LauncherController.h
@@ -67,7 +67,7 @@ public:
void HandleLauncherKeyPress(int when);
void HandleLauncherKeyRelease(bool was_tap, int when);
- bool HandleLauncherKeyEvent(unsigned long key_state, unsigned int key_code, Time timestamp);
+ bool HandleLauncherKeyEvent(unsigned long key_state, unsigned int key_sym, Time timestamp);
void KeyNavActivate();
void KeyNavGrab();
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index ea08b56dc..2c3f4b3eb 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -1885,10 +1885,7 @@ void UnityScreen::handleEvent(XEvent* event)
key_sym = key_sym - XK_KP_0 + XK_0;
}
- // Turn the key_sym back to a keycode, this turns keypad key_sym to the correct top row key_code
- unsigned int key_code = XKeysymToKeycode(nux::GetGraphicsDisplay()->GetX11Display(), key_sym);
-
- skip_other_plugins = launcher_controller_->HandleLauncherKeyEvent(XModifiersToNux(event->xkey.state), key_code, event->xkey.time);
+ skip_other_plugins = launcher_controller_->HandleLauncherKeyEvent(XModifiersToNux(event->xkey.state), key_sym, event->xkey.time);
if (!skip_other_plugins)
skip_other_plugins = dash_controller_->CheckShortcutActivation(XKeysymToString(key_sym));