• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 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 #include "virtual_keyboard.h"
18 
19 namespace vsoc_input_service {
20 
VirtualKeyboard()21 VirtualKeyboard::VirtualKeyboard()
22     : VirtualDeviceBase("VSoC keyboard", 0x6008) {}
23 
GetEventTypes() const24 const std::vector<const uint32_t>& VirtualKeyboard::GetEventTypes() const {
25   static const std::vector<const uint32_t> evt_types{EV_KEY};
26   return evt_types;
27 }
GetKeys() const28 const std::vector<const uint32_t>& VirtualKeyboard::GetKeys() const {
29   static const std::vector<const uint32_t> keys{
30       KEY_0,           KEY_1,          KEY_2,          KEY_3,
31       KEY_4,           KEY_5,          KEY_6,          KEY_7,
32       KEY_8,           KEY_9,          KEY_A,          KEY_AGAIN,
33       KEY_APOSTROPHE,  KEY_B,          KEY_BACKSLASH,  KEY_BACKSPACE,
34       KEY_C,           KEY_CAPSLOCK,   KEY_COMMA,      KEY_COMPOSE,
35       KEY_D,           KEY_DELETE,     KEY_DOT,        KEY_DOWN,
36       KEY_E,           KEY_END,        KEY_ENTER,      KEY_EQUAL,
37       KEY_ESC,         KEY_F,          KEY_F1,         KEY_F10,
38       KEY_F11,         KEY_F12,        KEY_F13,        KEY_F14,
39       KEY_F15,         KEY_F16,        KEY_F17,        KEY_F18,
40       KEY_F19,         KEY_F2,         KEY_F20,        KEY_F21,
41       KEY_F22,         KEY_F23,        KEY_F24,        KEY_F3,
42       KEY_F4,          KEY_F5,         KEY_F6,         KEY_F7,
43       KEY_F8,          KEY_F9,         KEY_FIND,       KEY_G,
44       KEY_GRAVE,       KEY_H,          KEY_HOME,       KEY_I,
45       KEY_INSERT,      KEY_J,          KEY_K,          KEY_KP0,
46       KEY_KP1,         KEY_KP2,        KEY_KP3,        KEY_KP4,
47       KEY_KP5,         KEY_KP6,        KEY_KP7,        KEY_KP8,
48       KEY_KP9,         KEY_KPASTERISK, KEY_KPCOMMA,    KEY_KPDOT,
49       KEY_KPENTER,     KEY_KPEQUAL,    KEY_KPMINUS,    KEY_KPPLUS,
50       KEY_KPPLUSMINUS, KEY_KPSLASH,    KEY_L,          KEY_LEFT,
51       KEY_LEFTALT,     KEY_LEFTBRACE,  KEY_LEFTCTRL,   KEY_LEFTMETA,
52       KEY_LEFTSHIFT,   KEY_LINEFEED,   KEY_M,          KEY_MENU,
53       KEY_MINUS,       KEY_MUTE,       KEY_N,          KEY_NUMLOCK,
54       KEY_O,           KEY_P,          KEY_PAGEDOWN,   KEY_PAGEUP,
55       KEY_PAUSE,       KEY_PRINT,      KEY_Q,          KEY_R,
56       KEY_RIGHT,       KEY_RIGHTALT,   KEY_RIGHTBRACE, KEY_RIGHTCTRL,
57       KEY_RIGHTMETA,   KEY_RIGHTSHIFT, KEY_S,          KEY_SCROLLLOCK,
58       KEY_SEMICOLON,   KEY_SLASH,      KEY_SPACE,      KEY_STOP,
59       KEY_SYSRQ,       KEY_T,          KEY_TAB,        KEY_U,
60       KEY_UNDO,        KEY_UP,         KEY_V,          KEY_VOLUMEDOWN,
61       KEY_VOLUMEUP,    KEY_W,          KEY_X,          KEY_Y,
62       KEY_YEN,         KEY_Z};
63   return keys;
64 }
65 
66 }  // namespace vsoc_input_service
67