OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "ui/base/keycodes/keyboard_code_conversion_wayland.h" |
| 6 |
| 7 #include <X11/keysym.h> |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" |
| 11 #include "base/stringprintf.h" |
| 12 #include "base/utf_string_conversions.h" |
| 13 #include "base/wayland/wayland_event.h" |
| 14 |
| 15 namespace ui { |
| 16 |
| 17 uint16 GetCharacterFromWaylandEvent(base::wayland::WaylandEvent* wev) |
| 18 { |
| 19 if(wev->key.sym < 256) |
| 20 return wev->key.sym; |
| 21 return 0; |
| 22 /* |
| 23 char buf[6]; |
| 24 int bytes_written = XLookupString(&wev->key.key, buf, 6, NULL, NULL); |
| 25 DCHECK_LE(bytes_written, 6); |
| 26 |
| 27 string16 result; |
| 28 return (bytes_written > 0 && UTF8ToUTF16(buf, bytes_written, &result) && |
| 29 result.length() == 1) ? result[0] : 0; |
| 30 */ |
| 31 } |
| 32 |
| 33 } // namespace ui |
OLD | NEW |