summaryrefslogtreecommitdiff
path: root/shortcuts
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2015-11-04 13:42:13 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2015-11-04 13:42:13 +0100
commit18b08f01058208799aeeb1ce5274fae03b5caa65 (patch)
tree0a79f629182a902e9e089f7821cc0a4735badf40 /shortcuts
parentf0f025360827f145030ab56c466957f02c56ef6a (diff)
CompizShortcutModeller: add Alt+key_right_to_Tab and Up/Down arrows
(bzr r3983.14.3)
Diffstat (limited to 'shortcuts')
-rw-r--r--shortcuts/CompizShortcutModeller.cpp35
1 files changed, 30 insertions, 5 deletions
diff --git a/shortcuts/CompizShortcutModeller.cpp b/shortcuts/CompizShortcutModeller.cpp
index bc1f64fc9..8692e10ee 100644
--- a/shortcuts/CompizShortcutModeller.cpp
+++ b/shortcuts/CompizShortcutModeller.cpp
@@ -19,9 +19,12 @@
#include "config.h"
#include <glib/gi18n-lib.h>
+#include <core/core.h>
#include "CompizShortcutModeller.h"
#include "ShortcutHint.h"
+#include "ShortcutHintPrivate.h"
#include "unity-shared/WindowManager.h"
+#include "unity-shared/XKeyboardUtil.h"
namespace unity
{
@@ -244,11 +247,12 @@ void CompizModeller::AddSwitcherHints(std::list<shortcut::AbstractHint::Ptr> &hi
{
static const std::string switching(_("Switching"));
- hints.push_back(std::make_shared<shortcut::Hint>(switching, "", "",
- _("Switches between applications."),
- shortcut::OptionType::COMPIZ_KEY,
- UNITYSHELL_PLUGIN_NAME,
- UNITYSHELL_OPTION_ALT_TAB_FORWARD));
+ auto switcher_init = std::make_shared<shortcut::Hint>(switching, "", "",
+ _("Switches between applications."),
+ shortcut::OptionType::COMPIZ_KEY,
+ UNITYSHELL_PLUGIN_NAME,
+ UNITYSHELL_OPTION_ALT_TAB_FORWARD);
+ hints.push_back(switcher_init);
if (ws_enabled)
{
@@ -269,6 +273,27 @@ void CompizModeller::AddSwitcherHints(std::list<shortcut::AbstractHint::Ptr> &hi
_("Moves the focus."),
shortcut::OptionType::HARDCODED,
_("Cursor Left or Right")));
+
+ hints.push_back(std::make_shared<shortcut::Hint>(switching, "", "",
+ _("Enter / Exit from spread mode or Select windows."),
+ shortcut::OptionType::HARDCODED,
+ _("Cursor Up or Down")));
+
+ if (const char* key = XKeysymToString(keyboard::get_key_right_to_key_symbol(screen->dpy(), XStringToKeysym("Tab"))))
+ {
+ std::string closekey = key;
+ switcher_init->Fill();
+ auto const& switcher_init_key = switcher_init->shortkey();
+ auto meta_separator = switcher_init_key.find("+");
+
+ if (meta_separator != std::string::npos)
+ closekey = switcher_init_key.substr(0, meta_separator-1) + " + " + closekey;
+
+ hints.push_back(std::make_shared<shortcut::Hint>(switching, "", "",
+ _("Closes the selected application / window."),
+ shortcut::OptionType::HARDCODED,
+ impl::ProperCase(closekey)));
+ }
}
void CompizModeller::AddWorkspaceHints(std::list<shortcut::AbstractHint::Ptr> &hints)