• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2024 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 use crate::input::KeyboardType;
18 
19 // TODO(b/263559234): Categorize some of these to KeyboardType::None based on ability to produce
20 //  key events at all. (Requires setup allowing InputDevice to dynamically add/remove
21 //  KeyboardInputMapper based on blocklist and KeyEvents in case a KeyboardType::None device ends
22 //  up producing a key event)
23 
24 /// This list pre-classifies a device into Alphabetic/Non-Alphabetic keyboard and tells us whether
25 /// further re-classification should be allowed or not (using is_finalized value).
26 /// This list DOES NOT change the source of the device or change the input mappers associated with
27 /// the device. It only changes the "KeyboardType" classification. This list should be primarily
28 /// used to pre-classify devices that are NOT keyboards(like mice, game pads, etc.) but generate
29 /// evdev nodes that say that they are alphabetic keyboards.
30 ///
31 /// NOTE: Pls keep the list sorted by vendor id and product id for easy searching.
32 pub static CLASSIFIED_DEVICES: &[(
33     /* vendorId */ u16,
34     /* productId */ u16,
35     KeyboardType,
36     /* is_finalized */ bool,
37 )] = &[
38     // HP X4000 Wireless Mouse
39     (0x03f0, 0xa407, KeyboardType::NonAlphabetic, true),
40     // Microsoft Wireless Mobile Mouse 6000
41     (0x045e, 0x0745, KeyboardType::NonAlphabetic, true),
42     // Microsoft Surface Precision Mouse
43     (0x045e, 0x0821, KeyboardType::NonAlphabetic, true),
44     // Microsoft Pro IntelliMouse
45     (0x045e, 0x082a, KeyboardType::NonAlphabetic, true),
46     // Microsoft Bluetooth Mouse
47     (0x045e, 0x082f, KeyboardType::NonAlphabetic, true),
48     // Xbox One Elite Series 2 gamepad
49     (0x045e, 0x0b05, KeyboardType::NonAlphabetic, true),
50     // Logitech T400
51     (0x046d, 0x4026, KeyboardType::NonAlphabetic, true),
52     // Logitech M720 Triathlon (Unifying)
53     (0x046d, 0x405e, KeyboardType::NonAlphabetic, true),
54     // Logitech MX Master 2S (Unifying)
55     (0x046d, 0x4069, KeyboardType::NonAlphabetic, true),
56     // Logitech M585 (Unifying)
57     (0x046d, 0x406b, KeyboardType::NonAlphabetic, true),
58     // Logitech MX Anywhere 2 (Unifying)
59     (0x046d, 0x4072, KeyboardType::NonAlphabetic, true),
60     // Logitech Pebble M350
61     (0x046d, 0x4080, KeyboardType::NonAlphabetic, true),
62     // Logitech T630 Ultrathin
63     (0x046d, 0xb00d, KeyboardType::NonAlphabetic, true),
64     // Logitech M558
65     (0x046d, 0xb011, KeyboardType::NonAlphabetic, true),
66     // Logitech MX Master (Bluetooth)
67     (0x046d, 0xb012, KeyboardType::NonAlphabetic, true),
68     // Logitech MX Anywhere 2 (Bluetooth)
69     (0x046d, 0xb013, KeyboardType::NonAlphabetic, true),
70     // Logitech M720 Triathlon (Bluetooth)
71     (0x046d, 0xb015, KeyboardType::NonAlphabetic, true),
72     // Logitech M535
73     (0x046d, 0xb016, KeyboardType::NonAlphabetic, true),
74     // Logitech MX Master / Anywhere 2 (Bluetooth)
75     (0x046d, 0xb017, KeyboardType::NonAlphabetic, true),
76     // Logitech MX Master 2S (Bluetooth)
77     (0x046d, 0xb019, KeyboardType::NonAlphabetic, true),
78     // Logitech MX Anywhere 2S (Bluetooth)
79     (0x046d, 0xb01a, KeyboardType::NonAlphabetic, true),
80     // Logitech M585/M590 (Bluetooth)
81     (0x046d, 0xb01b, KeyboardType::NonAlphabetic, true),
82     // Logitech G603 Lightspeed Gaming Mouse (Bluetooth)
83     (0x046d, 0xb01c, KeyboardType::NonAlphabetic, true),
84     // Logitech MX Master (Bluetooth)
85     (0x046d, 0xb01e, KeyboardType::NonAlphabetic, true),
86     // Logitech MX Anywhere 2 (Bluetooth)
87     (0x046d, 0xb01f, KeyboardType::NonAlphabetic, true),
88     // Logitech MX Master 3 (Bluetooth)
89     (0x046d, 0xb023, KeyboardType::NonAlphabetic, true),
90     // Logitech G604 Lightspeed Gaming Mouse (Bluetooth)
91     (0x046d, 0xb024, KeyboardType::NonAlphabetic, true),
92     // Logitech Spotlight Presentation Remote (Bluetooth)
93     (0x046d, 0xb503, KeyboardType::NonAlphabetic, true),
94     // Logitech R500 (Bluetooth)
95     (0x046d, 0xb505, KeyboardType::NonAlphabetic, true),
96     // Logitech M500s
97     (0x046d, 0xc093, KeyboardType::NonAlphabetic, true),
98     // Logitech Spotlight Presentation Remote (USB dongle)
99     (0x046d, 0xc53e, KeyboardType::NonAlphabetic, true),
100     // Elecom Enelo IR LED Mouse 350
101     (0x056e, 0x0134, KeyboardType::NonAlphabetic, true),
102     // Elecom EPRIM Blue LED 5 button mouse 228
103     (0x056e, 0x0141, KeyboardType::NonAlphabetic, true),
104     // Elecom Blue LED Mouse 203
105     (0x056e, 0x0159, KeyboardType::NonAlphabetic, true),
106     // Zebra LS2208 barcode scanner
107     (0x05e0, 0x1200, KeyboardType::NonAlphabetic, true),
108     // Glorious O2 Wireless
109     (0x093a, 0x822d, KeyboardType::NonAlphabetic, true),
110     // RDing FootSwitch1F1
111     (0x0c45, 0x7403, KeyboardType::NonAlphabetic, true),
112     // SteelSeries Sensei RAW Frost Blue
113     (0x1038, 0x1369, KeyboardType::NonAlphabetic, true),
114     // SteelSeries Rival 3 Wired
115     (0x1038, 0x1824, KeyboardType::NonAlphabetic, true),
116     // SteelSeries Rival 3 Wireless (USB dongle)
117     (0x1038, 0x1830, KeyboardType::NonAlphabetic, true),
118     // Yubico.com Yubikey
119     (0x1050, 0x0010, KeyboardType::NonAlphabetic, true),
120     // Yubico.com Yubikey 4 OTP+U2F+CCID
121     (0x1050, 0x0407, KeyboardType::NonAlphabetic, true),
122     // Razer DeathAdder Essential
123     (0x1532, 0x0098, KeyboardType::NonAlphabetic, true),
124     // Lenovo USB-C Wired Compact Mouse
125     (0x17ef, 0x6123, KeyboardType::NonAlphabetic, true),
126     // Corsair Katar Pro Wireless (USB dongle)
127     (0x1b1c, 0x1b94, KeyboardType::NonAlphabetic, true),
128     // Corsair Katar Pro Wireless (Bluetooth)
129     (0x1bae, 0x1b1c, KeyboardType::NonAlphabetic, true),
130     // Kensington Pro Fit Full-size
131     (0x1bcf, 0x08a0, KeyboardType::NonAlphabetic, true),
132     // Huion HS64
133     (0x256c, 0x006d, KeyboardType::NonAlphabetic, true),
134     // XP-Pen Star G640
135     (0x28bd, 0x0914, KeyboardType::NonAlphabetic, true),
136     // XP-Pen Artist 12 Pro
137     (0x28bd, 0x091f, KeyboardType::NonAlphabetic, true),
138     // XP-Pen Deco mini7W
139     (0x28bd, 0x0928, KeyboardType::NonAlphabetic, true),
140 ];
141