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

Side by Side Diff: webkit/glue/webinputevent_linux.cc

Issue 28105: Implement accelerators in the gtk port. (Closed)
Patch Set: Fixes for evanm Created 11 years, 10 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
« webkit/glue/webinputevent.h ('K') | « webkit/glue/webinputevent.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "config.h" 5 #include "config.h"
6 6
7 #include "webkit/glue/webinputevent.h" 7 #include "webkit/glue/webinputevent.h"
8 8
9 #include "KeyboardCodes.h" 9 #include "KeyboardCodes.h"
10 #include "KeyCodeConversion.h" 10 #include "KeyCodeConversion.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 delta_x = -kWheelDelta; 132 delta_x = -kWheelDelta;
133 break; 133 break;
134 case GDK_SCROLL_RIGHT: 134 case GDK_SCROLL_RIGHT:
135 delta_x = kWheelDelta; 135 delta_x = kWheelDelta;
136 break; 136 break;
137 default: 137 default:
138 break; 138 break;
139 } 139 }
140 } 140 }
141 141
142 WebKeyboardEvent::WebKeyboardEvent(const GdkEventKey* event) { 142 WebKeyboardEvent::WebKeyboardEvent(const GdkEventKey* event)
143 : gdk_keyval(event->keyval),
144 gdk_modifier(event->state) {
143 modifiers = GdkStateToWebEventModifiers(event->state); 145 modifiers = GdkStateToWebEventModifiers(event->state);
144 146
145 // GDK only exposes key press and release events. By contrast, 147 // GDK only exposes key press and release events. By contrast,
146 // WebKeyboardEvent matches Windows and wants key down/up events along with a 148 // WebKeyboardEvent matches Windows and wants key down/up events along with a
147 // separate CHAR event. 149 // separate CHAR event.
148 // We require the caller to simulate the CHAR event manually. See 150 // We require the caller to simulate the CHAR event manually. See
149 // test_shell's webwidget_host for an example. 151 // test_shell's webwidget_host for an example.
150 switch (event->type) { 152 switch (event->type) {
151 case GDK_KEY_RELEASE: 153 case GDK_KEY_RELEASE:
152 type = KEY_UP; 154 type = KEY_UP;
(...skipping 20 matching lines...) Expand all
173 text = '\r'; 175 text = '\r';
174 break; 176 break;
175 default: 177 default:
176 // This should set text to 0 when it's not a real character. 178 // This should set text to 0 when it's not a real character.
177 text = gdk_keyval_to_unicode(event->keyval); 179 text = gdk_keyval_to_unicode(event->keyval);
178 break; 180 break;
179 } 181 }
180 182
181 // TODO(tc): Do we need to set IS_AUTO_REPEAT or IS_KEYPAD? 183 // TODO(tc): Do we need to set IS_AUTO_REPEAT or IS_KEYPAD?
182 } 184 }
OLDNEW
« webkit/glue/webinputevent.h ('K') | « webkit/glue/webinputevent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698