| 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 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // types will match this EventMatcher. Similarly, if |key_matcher| is missing, | 35 // types will match this EventMatcher. Similarly, if |key_matcher| is missing, |
| 36 // then all key-events will match. | 36 // then all key-events will match. |
| 37 // An example matcher to match the Ctrl+A accelerator would be: | 37 // An example matcher to match the Ctrl+A accelerator would be: |
| 38 // - |type_matcher.type| = mus::mojom::EventType::KEY_PRESSED | 38 // - |type_matcher.type| = mus::mojom::EventType::KEY_PRESSED |
| 39 // - |flags_matcher.flags| = mus::mojom::kEventVlagControlDown | 39 // - |flags_matcher.flags| = mus::mojom::kEventVlagControlDown |
| 40 // - |key_matcher.keyboard_code| = mus::mojom::KeyboardCode::A | 40 // - |key_matcher.keyboard_code| = mus::mojom::KeyboardCode::A |
| 41 // | 41 // |
| 42 // A matcher to match any key-press event would be: | 42 // A matcher to match any key-press event would be: |
| 43 // - |type_matcher.type| = mus::mojom::EventType::KEY_PRESSED | 43 // - |type_matcher.type| = mus::mojom::EventType::KEY_PRESSED |
| 44 struct EventMatcher { | 44 struct EventMatcher { |
| 45 // TODO(jamescook): Move this to somewhere accelerator-specific. |
| 45 AcceleratorPhase accelerator_phase; | 46 AcceleratorPhase accelerator_phase; |
| 46 EventTypeMatcher? type_matcher; | 47 EventTypeMatcher? type_matcher; |
| 47 EventFlagsMatcher? flags_matcher; | 48 EventFlagsMatcher? flags_matcher; |
| 48 // These flags will be stripped from incoming events' flags when comparing | 49 // These flags will be stripped from incoming events' flags when comparing |
| 49 // against |flags_matcher|. | 50 // against |flags_matcher|. |
| 50 EventFlagsMatcher? ignore_flags_matcher; | 51 EventFlagsMatcher? ignore_flags_matcher; |
| 51 KeyEventMatcher? key_matcher; | 52 KeyEventMatcher? key_matcher; |
| 52 PointerKindMatcher? pointer_kind_matcher; | 53 PointerKindMatcher? pointer_kind_matcher; |
| 53 PointerLocationMatcher? pointer_location_matcher; | 54 PointerLocationMatcher? pointer_location_matcher; |
| 54 }; | 55 }; |
| OLD | NEW |