Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Unified Diff: chrome/browser/ui/ash/event_rewriter.h

Issue 11421055: Add power-user keyboard mode for ChromeOS with Search key acting as a typical Fn key. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't avoid remapping Alt-Up etc when a PrefService isn't around Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/event_rewriter.h
diff --git a/chrome/browser/ui/ash/event_rewriter.h b/chrome/browser/ui/ash/event_rewriter.h
index 1d01ed4a2695a9250a45fb2a6341d7d48b40bdc5..c0e81a9e6f2c6750f65f006cc769acd8a051a8a2 100644
--- a/chrome/browser/ui/ash/event_rewriter.h
+++ b/chrome/browser/ui/ash/event_rewriter.h
@@ -95,7 +95,8 @@ class EventRewriter : public ash::EventRewriterDelegate,
#endif
// Rewrites the |event| by applying all RewriteXXX functions as needed.
- void Rewrite(ui::KeyEvent* event);
+ // Returns whether the event should be rewritten or dropped.
+ ash::EventRewriterDelegate::Action Rewrite(ui::KeyEvent* event);
// Rewrites a modifier key press/release following the current user
// preferences.
@@ -116,8 +117,21 @@ class EventRewriter : public ash::EventRewriterDelegate,
// * Alt+Down -> Next (aka PageDown)
// * Ctrl+Alt+Up -> Home
// * Ctrl+Alt+Down -> End
+ // When the Search key acts as a function key, it instead maps:
+ // * Search+Backspace -> Delete
+ // * Search+Up -> Prior (aka PageUp)
+ // * Search+Down -> Next (aka PageDown)
+ // * Search+Left -> Home
+ // * Search+right -> End
+ // Returns true whn the |event| is rewritten.
Yusuke Sato 2012/11/26 06:09:38 nit: when
danakj 2012/11/26 19:36:26 Done.
bool RewriteBackspaceAndArrowKeys(ui::KeyEvent* event);
+#if defined(OS_CHROMEOS)
+ // When the Search key acts as a function key, it drops Search key presses,
+ // and drops the release as well if any key is pressed while Search was down.
+ bool DropSearchKey(ui::KeyEvent* event);
+#endif
+
// Rewrites the located |event|.
void RewriteLocatedEvent(ui::LocatedEvent* event);
@@ -146,6 +160,10 @@ class EventRewriter : public ash::EventRewriterDelegate,
int last_device_id_;
#if defined(OS_CHROMEOS)
+ bool drop_search_key_release_;
Yusuke Sato 2012/11/26 06:09:38 nit: you might want to remove line 164-166.
danakj 2012/11/26 19:36:26 Done.
+#endif
+
+#if defined(OS_CHROMEOS)
// X keycodes corresponding to various keysyms.
unsigned int control_l_xkeycode_;
unsigned int control_r_xkeycode_;
@@ -172,6 +190,18 @@ class EventRewriter : public ash::EventRewriterDelegate,
unsigned int kp_8_xkeycode_;
unsigned int kp_9_xkeycode_;
unsigned int kp_decimal_xkeycode_;
+ unsigned int f1_xkeycode_;
Yusuke Sato 2012/11/26 06:09:38 Looks like this part is for the next CL.
danakj 2012/11/26 19:36:26 Done.
+ unsigned int f2_xkeycode_;
+ unsigned int f3_xkeycode_;
+ unsigned int f4_xkeycode_;
+ unsigned int f5_xkeycode_;
+ unsigned int f6_xkeycode_;
+ unsigned int f7_xkeycode_;
+ unsigned int f8_xkeycode_;
+ unsigned int f9_xkeycode_;
+ unsigned int f10_xkeycode_;
+ unsigned int f11_xkeycode_;
+ unsigned int f12_xkeycode_;
chromeos::input_method::XKeyboard* xkeyboard_; // for testing.
#endif

Powered by Google App Engine
This is Rietveld 408576698