Merge lp:~loic.molinari/unity/unity-keyboard-navigation into lp:unity

Proposed by Loïc Molinari
Status: Merged
Merge reported by: Mirco Müller
Merged at revision: not available
Proposed branch: lp:~loic.molinari/unity/unity-keyboard-navigation
Merge into: lp:unity
Diff against target: 119 lines (+43/-1)
5 files modified
src/Launcher.cpp (+19/-0)
src/Launcher.h (+3/-0)
src/unityshell.cpp (+12/-0)
src/unityshell.h (+4/-1)
unityshell.xml.in (+5/-0)
To merge this branch: bzr merge lp:~loic.molinari/unity/unity-keyboard-navigation
Reviewer Review Type Date Requested Status
Neil J. Patel Pending
Review via email: mp+47540@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/Launcher.cpp'
--- src/Launcher.cpp 2011-01-26 14:11:37 +0000
+++ src/Launcher.cpp 2011-01-26 15:39:45 +0000
@@ -188,6 +188,9 @@
188 OnMouseMove.connect (sigc::mem_fun (this, &Launcher::RecvMouseMove));188 OnMouseMove.connect (sigc::mem_fun (this, &Launcher::RecvMouseMove));
189 OnMouseWheel.connect (sigc::mem_fun (this, &Launcher::RecvMouseWheel));189 OnMouseWheel.connect (sigc::mem_fun (this, &Launcher::RecvMouseWheel));
190190
191 OnKeyPressed.connect (sigc::mem_fun (this, &Launcher::RecvKeyPressed));
192 OnKeyReleased.connect (sigc::mem_fun (this, &Launcher::RecvKeyReleased));
193
191 QuicklistManager::Default ()->quicklist_opened.connect (sigc::mem_fun(this, &Launcher::RecvQuicklistOpened));194 QuicklistManager::Default ()->quicklist_opened.connect (sigc::mem_fun(this, &Launcher::RecvQuicklistOpened));
192 QuicklistManager::Default ()->quicklist_closed.connect (sigc::mem_fun(this, &Launcher::RecvQuicklistClosed));195 QuicklistManager::Default ()->quicklist_closed.connect (sigc::mem_fun(this, &Launcher::RecvQuicklistClosed));
193 196
@@ -1950,6 +1953,22 @@
1950 EnsureAnimation ();1953 EnsureAnimation ();
1951}1954}
19521955
1956void Launcher::RecvKeyPressed (unsigned int key_sym, unsigned long key_code,
1957 unsigned long key_state)
1958{
1959 // FIXME(loicm) Hey Mirco, now you can put your stuff here ...
1960 fprintf (stdout, "Launcher::RecvKeyPressed (%d, %ld, %ld)\n", key_sym,
1961 key_code, key_state);
1962}
1963
1964void Launcher::RecvKeyReleased (unsigned int key_sym, unsigned long key_code,
1965 unsigned long key_state)
1966{
1967 // FIXME(loicm) ... and there ;)
1968 fprintf (stdout, "Launcher::RecvKeyReleased (%d, %ld, %ld)\n", key_sym,
1969 key_code, key_state);
1970}
1971
1953void Launcher::RecvQuicklistOpened (QuicklistView *quicklist)1972void Launcher::RecvQuicklistOpened (QuicklistView *quicklist)
1954{1973{
1955 EventLogic ();1974 EventLogic ();
19561975
=== modified file 'src/Launcher.h'
--- src/Launcher.h 2011-01-24 11:26:31 +0000
+++ src/Launcher.h 2011-01-26 15:39:45 +0000
@@ -108,6 +108,9 @@
108 virtual void RecvMouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);108 virtual void RecvMouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
109 virtual void RecvMouseWheel(int x, int y, int wheel_delta, unsigned long button_flags, unsigned long key_flags);109 virtual void RecvMouseWheel(int x, int y, int wheel_delta, unsigned long button_flags, unsigned long key_flags);
110110
111 virtual void RecvKeyPressed (unsigned int key_sym, unsigned long key_code, unsigned long key_state);
112 virtual void RecvKeyReleased (unsigned int key_sym, unsigned long key_code, unsigned long key_state);
113
111 virtual void RecvQuicklistOpened (QuicklistView *quicklist);114 virtual void RecvQuicklistOpened (QuicklistView *quicklist);
112 virtual void RecvQuicklistClosed (QuicklistView *quicklist);115 virtual void RecvQuicklistClosed (QuicklistView *quicklist);
113116
114117
=== modified file 'src/unityshell.cpp'
--- src/unityshell.cpp 2011-01-24 10:44:25 +0000
+++ src/unityshell.cpp 2011-01-26 15:39:45 +0000
@@ -209,6 +209,17 @@
209 return false;209 return false;
210}210}
211211
212bool
213UnityScreen::navigateLauncherKeyInitiate (CompAction *action,
214 CompAction::State state,
215 CompOption::Vector &options)
216{
217 CompWindow *w = screen->findWindow (launcherWindow->GetInputWindowId ());
218 if (w != NULL)
219 w->moveInputFocusTo ();
220 return false;
221}
222
212gboolean223gboolean
213UnityScreen::initPluginActions (gpointer data)224UnityScreen::initPluginActions (gpointer data)
214{225{
@@ -487,6 +498,7 @@
487 optionSetUrgentAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));498 optionSetUrgentAnimationNotify (boost::bind (&UnityScreen::optionChanged, this, _1, _2));
488 optionSetShowLauncherInitiate (boost::bind (&UnityScreen::showLauncherKeyInitiate, this, _1, _2, _3));499 optionSetShowLauncherInitiate (boost::bind (&UnityScreen::showLauncherKeyInitiate, this, _1, _2, _3));
489 optionSetShowLauncherTerminate (boost::bind (&UnityScreen::showLauncherKeyTerminate, this, _1, _2, _3));500 optionSetShowLauncherTerminate (boost::bind (&UnityScreen::showLauncherKeyTerminate, this, _1, _2, _3));
501 optionSetNavigateLauncherInitiate (boost::bind (&UnityScreen::navigateLauncherKeyInitiate, this, _1, _2, _3));
490502
491 g_timeout_add (0, &UnityScreen::initPluginActions, this);503 g_timeout_add (0, &UnityScreen::initPluginActions, this);
492 g_timeout_add (5000, (GSourceFunc) write_logger_data_to_disk, NULL);504 g_timeout_add (5000, (GSourceFunc) write_logger_data_to_disk, NULL);
493505
=== modified file 'src/unityshell.h'
--- src/unityshell.h 2011-01-20 04:06:54 +0000
+++ src/unityshell.h 2011-01-26 15:39:45 +0000
@@ -100,6 +100,9 @@
100 showLauncherKeyTerminate (CompAction *action, CompAction::State state,100 showLauncherKeyTerminate (CompAction *action, CompAction::State state,
101 CompOption::Vector &options);101 CompOption::Vector &options);
102102
103 bool navigateLauncherKeyInitiate (CompAction *action, CompAction::State state,
104 CompOption::Vector &options);
105
103 /* handle option changes and change settings inside of the106 /* handle option changes and change settings inside of the
104 * panel and dock views */107 * panel and dock views */
105 void optionChanged (CompOption *, Options num);108 void optionChanged (CompOption *, Options num);
@@ -155,7 +158,7 @@
155 bool damaged;158 bool damaged;
156 CompWindowList _withRemovedNuxWindows;159 CompWindowList _withRemovedNuxWindows;
157160
158 friend class UnityWindow;161 friend class UnityWindow;
159};162};
160163
161class UnityWindow :164class UnityWindow :
162165
=== modified file 'unityshell.xml.in'
--- unityshell.xml.in 2011-01-04 16:16:10 +0000
+++ unityshell.xml.in 2011-01-26 15:39:45 +0000
@@ -49,6 +49,11 @@
49 <_long>Make the launcher appear with that key</_long>49 <_long>Make the launcher appear with that key</_long>
50 <default>&lt;Super&gt;</default>50 <default>&lt;Super&gt;</default>
51 </option>51 </option>
52 <option name="navigate_launcher" type="key">
53 <_short>Navigate launcher</_short>
54 <_long>Navigate the launcher with the keyboard</_long>
55 <default>&lt;Alt&gt;F1</default>
56 </option>
52 </group>57 </group>
53 <group>58 <group>
54 <_short>Experimental</_short>59 <_short>Experimental</_short>