1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/test/remoting/key_code_conv.h"
7 #include "chrome/test/remoting/key_code_map.h"
11 ui::KeyboardCode
InvalidKeyboardCode() {
12 return key_code_map
[0].vkey_code
;
15 void GetKeyValuesFromChar(
16 char c
, const char** code
, ui::KeyboardCode
* vkey_code
, bool* shift
) {
18 *vkey_code
= InvalidKeyboardCode();
20 for (size_t i
= 0; i
< arraysize(key_code_map
); ++i
) {
21 if (key_code_map
[i
].lower_char
== c
) {
22 *code
= key_code_map
[i
].code
;
23 *vkey_code
= key_code_map
[i
].vkey_code
;
28 if (key_code_map
[i
].upper_char
== c
) {
29 *code
= key_code_map
[i
].code
;
30 *vkey_code
= key_code_map
[i
].vkey_code
;
36 } // namespace remoting