• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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  */
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 
XKeyToSkKey(KeySym keysym)16 SkKey XKeyToSkKey(KeySym keysym) {
17     switch (keysym) {
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;
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
39