OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 module mus.mojom; | 5 module mus.mojom; |
6 | 6 |
7 import "components/mus/public/interfaces/input_event_constants.mojom"; | 7 import "components/mus/public/interfaces/input_event_constants.mojom"; |
8 import "components/mus/public/interfaces/input_key_codes.mojom"; | 8 import "components/mus/public/interfaces/input_key_codes.mojom"; |
9 import "ui/mojo/geometry/geometry.mojom"; | 9 import "ui/mojo/geometry/geometry.mojom"; |
10 | 10 |
11 struct KeyEventMatcher { | 11 struct KeyEventMatcher { |
12 KeyboardCode keyboard_code; | 12 KeyboardCode keyboard_code; |
13 }; | 13 }; |
14 | 14 |
15 struct PointerKindMatcher { | 15 struct PointerKindMatcher { |
16 PointerKind pointer_kind; | 16 PointerKind pointer_kind; |
17 }; | 17 }; |
18 | 18 |
19 struct PointerLocationMatcher { | 19 struct PointerLocationMatcher { |
20 mojo.RectF region; | 20 mojo.RectF region; |
21 }; | 21 }; |
22 | 22 |
23 struct EventTypeMatcher { | 23 struct EventTypeMatcher { |
24 EventType type; | 24 EventType type; |
25 }; | 25 }; |
26 | 26 |
27 struct EventFlagsMatcher { | 27 struct EventFlagsMatcher { |
28 EventFlags flags; | 28 int32 flags; |
yzshen1
2016/01/07 19:24:52
Please add comments about what flags is. Previousl
Sam McNally
2016/01/08 05:12:51
Done.
| |
29 }; | 29 }; |
30 | 30 |
31 // If a specific matcher is missing, then an Event will match this EventMatcher | 31 // If a specific matcher is missing, then an Event will match this EventMatcher |
32 // (if relevant). For example, if |type_matcher| is missing, then events of all | 32 // (if relevant). For example, if |type_matcher| is missing, then events of all |
33 // types will match this EventMatcher. Similarly, if |key_matcher| is missing, | 33 // types will match this EventMatcher. Similarly, if |key_matcher| is missing, |
34 // then all key-events will match. | 34 // then all key-events will match. |
35 // An example matcher to match the Ctrl+A accelerator would be: | 35 // An example matcher to match the Ctrl+A accelerator would be: |
36 // - |type_matcher.type| = mojo::EVENT_TYPE_KEY_PRESSED | 36 // - |type_matcher.type| = mojo::EVENT_TYPE_KEY_PRESSED |
37 // - |flags_matcher.flags| = mojo::EVENT_FLAGS_CONTROL_DOWN | 37 // - |flags_matcher.flags| = mojo::EVENT_FLAGS_CONTROL_DOWN |
38 // - |key_matcher.keyboard_code| = mojo::KEYBOARD_CODE_A | 38 // - |key_matcher.keyboard_code| = mojo::KEYBOARD_CODE_A |
39 // | 39 // |
40 // A matcher to match any key-press event would be: | 40 // A matcher to match any key-press event would be: |
41 // - |type_matcher.type| = mojo::EVENT_TYPE_KEY_PRESSED | 41 // - |type_matcher.type| = mojo::EVENT_TYPE_KEY_PRESSED |
42 struct EventMatcher { | 42 struct EventMatcher { |
43 EventTypeMatcher? type_matcher; | 43 EventTypeMatcher? type_matcher; |
44 EventFlagsMatcher? flags_matcher; | 44 EventFlagsMatcher? flags_matcher; |
45 // These flags will be stripped from incoming events' flags when comparing | 45 // These flags will be stripped from incoming events' flags when comparing |
46 // against |flags_matcher|. | 46 // against |flags_matcher|. |
47 EventFlagsMatcher? ignore_flags_matcher; | 47 EventFlagsMatcher? ignore_flags_matcher; |
48 KeyEventMatcher? key_matcher; | 48 KeyEventMatcher? key_matcher; |
49 PointerKindMatcher? pointer_kind_matcher; | 49 PointerKindMatcher? pointer_kind_matcher; |
50 PointerLocationMatcher? pointer_location_matcher; | 50 PointerLocationMatcher? pointer_location_matcher; |
51 }; | 51 }; |
OLD | NEW |