1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/include/views/unix/XkeysToSkKeys.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2011 Google Inc. 1.7 + * 1.8 + * Use of this source code is governed by a BSD-style license that can be 1.9 + * found in the LICENSE file. 1.10 + */ 1.11 +#include "X11/Xlib.h" 1.12 +#include "X11/keysym.h" 1.13 + 1.14 +#include "SkKey.h" 1.15 + 1.16 +#ifndef XKEYS_TOSKKEYS_H 1.17 +#define XKEYS_TOSKKEYS_H 1.18 + 1.19 +SkKey XKeyToSkKey(KeySym keysym) { 1.20 + switch (keysym) { 1.21 + case XK_BackSpace: 1.22 + return kBack_SkKey; 1.23 + case XK_Return: 1.24 + return kOK_SkKey; 1.25 + case XK_Home: 1.26 + return kHome_SkKey; 1.27 + case XK_End: 1.28 + return kEnd_SkKey; 1.29 + case XK_Right: 1.30 + return kRight_SkKey; 1.31 + case XK_Left: 1.32 + return kLeft_SkKey; 1.33 + case XK_Down: 1.34 + return kDown_SkKey; 1.35 + case XK_Up: 1.36 + return kUp_SkKey; 1.37 + default: 1.38 + return kNONE_SkKey; 1.39 + } 1.40 +} 1.41 +#endif