epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
scroggo | b7e9aee | 2011-03-15 15:15:15 +0000 | [diff] [blame] | 8 | #include "X11/Xlib.h" |
| 9 | #include "X11/keysym.h" |
| 10 | |
| 11 | #include "SkKey.h" |
| 12 | |
| 13 | #ifndef XKEYS_TOSKKEYS_H |
| 14 | #define XKEYS_TOSKKEYS_H |
| 15 | |
| 16 | SkKey XKeyToSkKey(KeySym keysym) { |
| 17 | switch (keysym) { |
reed@google.com | 1fbb300 | 2011-05-17 20:44:54 +0000 | [diff] [blame] | 18 | case XK_BackSpace: |
| 19 | return kBack_SkKey; |
| 20 | case XK_Return: |
| 21 | return kOK_SkKey; |
| 22 | case XK_Home: |
| 23 | return kHome_SkKey; |
| 24 | case XK_End: |
| 25 | return kEnd_SkKey; |
scroggo | b7e9aee | 2011-03-15 15:15:15 +0000 | [diff] [blame] | 26 | case XK_Right: |
| 27 | return kRight_SkKey; |
| 28 | case XK_Left: |
| 29 | return kLeft_SkKey; |
| 30 | case XK_Down: |
| 31 | return kDown_SkKey; |
| 32 | case XK_Up: |
| 33 | return kUp_SkKey; |
| 34 | default: |
| 35 | return kNONE_SkKey; |
| 36 | } |
| 37 | } |
| 38 | #endif |