forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent_matcher_util.h
33 lines (23 loc) · 1.19 KB
/
event_matcher_util.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ASH_EVENT_MATCHER_UTIL_H_
#define ASH_EVENT_MATCHER_UTIL_H_
#include "services/ui/public/interfaces/event_matcher.mojom.h"
namespace ash {
// Builds a matcher which matches all key releases.
ui::mojom::EventMatcherPtr BuildKeyReleaseMatcher();
// Builds a matcher which matches any use of these modifier keys.
ui::mojom::EventMatcherPtr BuildAltMatcher();
ui::mojom::EventMatcherPtr BuildControlMatcher();
// Builds a matcher which matches a specific keycode.
ui::mojom::EventMatcherPtr BuildKeyMatcher(ui::mojom::KeyboardCode code);
// Adds key matchers for the range |start| to |end| inclusive.
void BuildKeyMatcherRange(ui::mojom::KeyboardCode start,
ui::mojom::KeyboardCode end,
std::vector<::ui::mojom::EventMatcherPtr>* matchers);
// Adds matchers for |codes| to |matchers|.
void BuildKeyMatcherList(std::vector<ui::mojom::KeyboardCode> codes,
std::vector<::ui::mojom::EventMatcherPtr>* matchers);
} // namespace ash
#endif // ASH_EVENT_MATCHER_UTIL_H_