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

Side by Side Diff: app/event_synthesis_gtk.cc

Issue 6246001: Move app/key* to ui/base/keycodes/* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « app/event_synthesis_gtk.h ('k') | app/keyboard_code_conversion.h » ('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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/event_synthesis_gtk.h" 5 #include "app/event_synthesis_gtk.h"
6 6
7 #include "app/keyboard_code_conversion_gtk.h" 7 #include "ui/base/keycodes/keyboard_code_conversion_gtk.h"
8 8
9 namespace app { 9 namespace app {
10 10
11 GdkEvent* SynthesizeKeyEvent(GdkWindow* window, 11 GdkEvent* SynthesizeKeyEvent(GdkWindow* window,
12 bool press, guint gdk_key, guint state) { 12 bool press, guint gdk_key, guint state) {
13 GdkEvent* event = gdk_event_new(press ? GDK_KEY_PRESS : GDK_KEY_RELEASE); 13 GdkEvent* event = gdk_event_new(press ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
14 14
15 event->key.type = press ? GDK_KEY_PRESS : GDK_KEY_RELEASE; 15 event->key.type = press ? GDK_KEY_PRESS : GDK_KEY_RELEASE;
16 event->key.window = window; 16 event->key.window = window;
17 if (window) 17 if (window)
(...skipping 14 matching lines...) Expand all
32 event->key.keyval, &keys, &n_keys)) { 32 event->key.keyval, &keys, &n_keys)) {
33 event->key.hardware_keycode = keys[0].keycode; 33 event->key.hardware_keycode = keys[0].keycode;
34 event->key.group = keys[0].group; 34 event->key.group = keys[0].group;
35 g_free(keys); 35 g_free(keys);
36 } 36 }
37 37
38 return event; 38 return event;
39 } 39 }
40 40
41 void SynthesizeKeyPressEvents(GdkWindow* window, 41 void SynthesizeKeyPressEvents(GdkWindow* window,
42 app::KeyboardCode key, 42 ui::KeyboardCode key,
43 bool control, bool shift, bool alt, 43 bool control, bool shift, bool alt,
44 std::vector<GdkEvent*>* events) { 44 std::vector<GdkEvent*>* events) {
45 if (control) 45 if (control)
46 events->push_back( 46 events->push_back(
47 SynthesizeKeyEvent(window, true, GDK_Control_L, 0)); 47 SynthesizeKeyEvent(window, true, GDK_Control_L, 0));
48 48
49 if (shift) { 49 if (shift) {
50 events->push_back(SynthesizeKeyEvent(window, true, GDK_Shift_L, 50 events->push_back(SynthesizeKeyEvent(window, true, GDK_Shift_L,
51 control ? GDK_CONTROL_MASK : 0)); 51 control ? GDK_CONTROL_MASK : 0));
52 } 52 }
(...skipping 28 matching lines...) Expand all
81 (control ? GDK_CONTROL_MASK : 0) | GDK_SHIFT_MASK)); 81 (control ? GDK_CONTROL_MASK : 0) | GDK_SHIFT_MASK));
82 } 82 }
83 83
84 if (control) { 84 if (control) {
85 events->push_back( 85 events->push_back(
86 SynthesizeKeyEvent(window, false, GDK_Control_L, GDK_CONTROL_MASK)); 86 SynthesizeKeyEvent(window, false, GDK_Control_L, GDK_CONTROL_MASK));
87 } 87 }
88 } 88 }
89 89
90 } // namespace app 90 } // namespace app
OLDNEW
« no previous file with comments | « app/event_synthesis_gtk.h ('k') | app/keyboard_code_conversion.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698