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

Side by Side Diff: chrome/browser/ui/ash/event_rewriter.h

Issue 11417144: Use rewriting to make ChromeOS keyboard F<number> keys produce extended keycodes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_ASH_EVENT_REWRITER_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_EVENT_REWRITER_H_
6 #define CHROME_BROWSER_UI_ASH_EVENT_REWRITER_H_ 6 #define CHROME_BROWSER_UI_ASH_EVENT_REWRITER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // * Ctrl+Alt+Down -> End 119 // * Ctrl+Alt+Down -> End
120 // When the Search key acts as a function key, it instead maps: 120 // When the Search key acts as a function key, it instead maps:
121 // * Search+Backspace -> Delete 121 // * Search+Backspace -> Delete
122 // * Search+Up -> Prior (aka PageUp) 122 // * Search+Up -> Prior (aka PageUp)
123 // * Search+Down -> Next (aka PageDown) 123 // * Search+Down -> Next (aka PageDown)
124 // * Search+Left -> Home 124 // * Search+Left -> Home
125 // * Search+right -> End 125 // * Search+right -> End
126 // Returns true whn the |event| is rewritten. 126 // Returns true whn the |event| is rewritten.
127 bool RewriteBackspaceAndArrowKeys(ui::KeyEvent* event); 127 bool RewriteBackspaceAndArrowKeys(ui::KeyEvent* event);
128 128
129 // When the Search key acts as a function key, it remaps Search+1
130 // through Search+= to F1 through F12. Returns true whn the |event| is
131 // rewritten.
132 bool RewriteFunctionKeys(ui::KeyEvent* event);
133
129 #if defined(OS_CHROMEOS) 134 #if defined(OS_CHROMEOS)
130 // When the Search key acts as a function key, it drops Search key presses, 135 // When the Search key acts as a function key, it drops Search key presses,
131 // and drops the release as well if any key is pressed while Search was down. 136 // and drops the release as well if any key is pressed while Search was down.
132 bool DropSearchKey(ui::KeyEvent* event); 137 bool DropSearchKey(ui::KeyEvent* event);
133 #endif 138 #endif
134 139
135 // Rewrites the located |event|. 140 // Rewrites the located |event|.
136 void RewriteLocatedEvent(ui::LocatedEvent* event); 141 void RewriteLocatedEvent(ui::LocatedEvent* event);
137 142
138 // Overwrites |event| with the keycodes and flags. 143 // Overwrites |event| with the keycodes and flags.
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 unsigned int f3_xkeycode_; 200 unsigned int f3_xkeycode_;
196 unsigned int f4_xkeycode_; 201 unsigned int f4_xkeycode_;
197 unsigned int f5_xkeycode_; 202 unsigned int f5_xkeycode_;
198 unsigned int f6_xkeycode_; 203 unsigned int f6_xkeycode_;
199 unsigned int f7_xkeycode_; 204 unsigned int f7_xkeycode_;
200 unsigned int f8_xkeycode_; 205 unsigned int f8_xkeycode_;
201 unsigned int f9_xkeycode_; 206 unsigned int f9_xkeycode_;
202 unsigned int f10_xkeycode_; 207 unsigned int f10_xkeycode_;
203 unsigned int f11_xkeycode_; 208 unsigned int f11_xkeycode_;
204 unsigned int f12_xkeycode_; 209 unsigned int f12_xkeycode_;
210 unsigned int browser_back_xkeycode_;
211 unsigned int browser_forward_xkeycode_;
212 unsigned int browser_refresh_xkeycode_;
213 unsigned int media_launch_app1_xkeycode_;
214 unsigned int media_launch_app2_xkeycode_;
215 unsigned int brightness_down_xkeycode_;
216 unsigned int brightness_up_xkeycode_;
217 unsigned int volume_mute_xkeycode_;
218 unsigned int volume_down_xkeycode_;
219 unsigned int volume_up_xkeycode_;
220 unsigned int power_xkeycode_;
205 221
206 chromeos::input_method::XKeyboard* xkeyboard_; // for testing. 222 chromeos::input_method::XKeyboard* xkeyboard_; // for testing.
207 #endif 223 #endif
208 224
209 const PrefService* pref_service_; // for testing. 225 const PrefService* pref_service_; // for testing.
210 226
211 DISALLOW_COPY_AND_ASSIGN(EventRewriter); 227 DISALLOW_COPY_AND_ASSIGN(EventRewriter);
212 }; 228 };
213 229
214 #endif // CHROME_BROWSER_UI_ASH_EVENT_REWRITER_H_ 230 #endif // CHROME_BROWSER_UI_ASH_EVENT_REWRITER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698