Chromium Code Reviews| 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 | |
| 12 struct AcceleratorPhaseMatcher { | |
| 13 AcceleratorPhase accelerator_phase; | |
| 14 }; | |
| 15 | |
| 11 struct KeyEventMatcher { | 16 struct KeyEventMatcher { |
| 12 KeyboardCode keyboard_code; | 17 KeyboardCode keyboard_code; |
| 13 }; | 18 }; |
| 14 | 19 |
| 15 struct PointerKindMatcher { | 20 struct PointerKindMatcher { |
| 16 PointerKind pointer_kind; | 21 PointerKind pointer_kind; |
| 17 }; | 22 }; |
| 18 | 23 |
| 19 struct PointerLocationMatcher { | 24 struct PointerLocationMatcher { |
| 20 mojo.RectF region; | 25 mojo.RectF region; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 35 // types will match this EventMatcher. Similarly, if |key_matcher| is missing, | 40 // types will match this EventMatcher. Similarly, if |key_matcher| is missing, |
| 36 // then all key-events will match. | 41 // then all key-events will match. |
| 37 // An example matcher to match the Ctrl+A accelerator would be: | 42 // An example matcher to match the Ctrl+A accelerator would be: |
| 38 // - |type_matcher.type| = mus::mojom::EventType::KEY_PRESSED | 43 // - |type_matcher.type| = mus::mojom::EventType::KEY_PRESSED |
| 39 // - |flags_matcher.flags| = mus::mojom::kEventVlagControlDown | 44 // - |flags_matcher.flags| = mus::mojom::kEventVlagControlDown |
| 40 // - |key_matcher.keyboard_code| = mus::mojom::KeyboardCode::A | 45 // - |key_matcher.keyboard_code| = mus::mojom::KeyboardCode::A |
| 41 // | 46 // |
| 42 // A matcher to match any key-press event would be: | 47 // A matcher to match any key-press event would be: |
| 43 // - |type_matcher.type| = mus::mojom::EventType::KEY_PRESSED | 48 // - |type_matcher.type| = mus::mojom::EventType::KEY_PRESSED |
| 44 struct EventMatcher { | 49 struct EventMatcher { |
| 50 AcceleratorPhaseMatcher accelerator_matcher; | |
|
sky
2016/03/04 16:51:55
As the phase is always required can you do away wi
jonross
2016/03/04 20:38:20
Certainly. Thought that will imply a default.
I w
sky
2016/03/04 21:36:16
Ah, I see what you're saying. I'm fine with pretar
jonross
2016/03/04 22:13:03
Awesome. Done.
| |
| 45 EventTypeMatcher? type_matcher; | 51 EventTypeMatcher? type_matcher; |
| 46 EventFlagsMatcher? flags_matcher; | 52 EventFlagsMatcher? flags_matcher; |
| 47 // These flags will be stripped from incoming events' flags when comparing | 53 // These flags will be stripped from incoming events' flags when comparing |
| 48 // against |flags_matcher|. | 54 // against |flags_matcher|. |
| 49 EventFlagsMatcher? ignore_flags_matcher; | 55 EventFlagsMatcher? ignore_flags_matcher; |
| 50 KeyEventMatcher? key_matcher; | 56 KeyEventMatcher? key_matcher; |
| 51 PointerKindMatcher? pointer_kind_matcher; | 57 PointerKindMatcher? pointer_kind_matcher; |
| 52 PointerLocationMatcher? pointer_location_matcher; | 58 PointerLocationMatcher? pointer_location_matcher; |
| 53 }; | 59 }; |
| OLD | NEW |