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

Side by Side Diff: ui/platform_window/x11/x11_window.cc

Issue 404203003: Distinguish between keystroke and character events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IsCharFromNative() for Mac build Created 6 years, 4 months 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
« no previous file with comments | « ui/platform_window/win/win_window.cc ('k') | ui/views/controls/combobox/combobox_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "ui/platform_window/x11/x11_window.h" 5 #include "ui/platform_window/x11/x11_window.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 #include <X11/Xatom.h> 8 #include <X11/Xatom.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #include <X11/Xutil.h> 10 #include <X11/Xutil.h>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 xwindow_ = None; 65 xwindow_ = None;
66 } 66 }
67 67
68 void X11Window::ProcessXInput2Event(XEvent* xev) { 68 void X11Window::ProcessXInput2Event(XEvent* xev) {
69 if (!TouchFactory::GetInstance()->ShouldProcessXI2Event(xev)) 69 if (!TouchFactory::GetInstance()->ShouldProcessXI2Event(xev))
70 return; 70 return;
71 EventType event_type = EventTypeFromNative(xev); 71 EventType event_type = EventTypeFromNative(xev);
72 switch (event_type) { 72 switch (event_type) {
73 case ET_KEY_PRESSED: 73 case ET_KEY_PRESSED:
74 case ET_KEY_RELEASED: { 74 case ET_KEY_RELEASED: {
75 KeyEvent key_event(xev, false); 75 KeyEvent key_event(xev);
76 delegate_->DispatchEvent(&key_event); 76 delegate_->DispatchEvent(&key_event);
77 break; 77 break;
78 } 78 }
79 case ET_MOUSE_PRESSED: 79 case ET_MOUSE_PRESSED:
80 case ET_MOUSE_MOVED: 80 case ET_MOUSE_MOVED:
81 case ET_MOUSE_DRAGGED: 81 case ET_MOUSE_DRAGGED:
82 case ET_MOUSE_RELEASED: { 82 case ET_MOUSE_RELEASED: {
83 MouseEvent mouse_event(xev); 83 MouseEvent mouse_event(xev);
84 delegate_->DispatchEvent(&mouse_event); 84 delegate_->DispatchEvent(&mouse_event);
85 break; 85 break;
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 gfx::Rect damage_rect(xev->xexpose.x, 271 gfx::Rect damage_rect(xev->xexpose.x,
272 xev->xexpose.y, 272 xev->xexpose.y,
273 xev->xexpose.width, 273 xev->xexpose.width,
274 xev->xexpose.height); 274 xev->xexpose.height);
275 delegate_->OnDamageRect(damage_rect); 275 delegate_->OnDamageRect(damage_rect);
276 break; 276 break;
277 } 277 }
278 278
279 case KeyPress: 279 case KeyPress:
280 case KeyRelease: { 280 case KeyRelease: {
281 KeyEvent key_event(xev, false); 281 KeyEvent key_event(xev);
282 delegate_->DispatchEvent(&key_event); 282 delegate_->DispatchEvent(&key_event);
283 break; 283 break;
284 } 284 }
285 285
286 case ButtonPress: 286 case ButtonPress:
287 case ButtonRelease: { 287 case ButtonRelease: {
288 switch (EventTypeFromNative(xev)) { 288 switch (EventTypeFromNative(xev)) {
289 case ET_MOUSEWHEEL: { 289 case ET_MOUSEWHEEL: {
290 MouseWheelEvent mouseev(xev); 290 MouseWheelEvent mouseev(xev);
291 delegate_->DispatchEvent(&mouseev); 291 delegate_->DispatchEvent(&mouseev);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 346
347 case GenericEvent: { 347 case GenericEvent: {
348 ProcessXInput2Event(xev); 348 ProcessXInput2Event(xev);
349 break; 349 break;
350 } 350 }
351 } 351 }
352 return POST_DISPATCH_STOP_PROPAGATION; 352 return POST_DISPATCH_STOP_PROPAGATION;
353 } 353 }
354 354
355 } // namespace ui 355 } // namespace ui
OLDNEW
« no previous file with comments | « ui/platform_window/win/win_window.cc ('k') | ui/views/controls/combobox/combobox_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698