gfx/skia/trunk/include/views/android/AndroidKeyToSkKey.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     2 /*
     3  * Copyright 2011 Skia
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
    10 #ifndef _ANDROID_TO_SKIA_KEYCODES_H
    11 #define _ANDROID_TO_SKIA_KEYCODES_H
    13 #include "android/keycodes.h"
    14 #include "SkKey.h"
    16 // Convert an Android keycode to an SkKey.  This is an incomplete list, only
    17 // including keys used by the sample app.
    18 SkKey AndroidKeycodeToSkKey(int keycode) {
    19     switch (keycode) {
    20         case AKEYCODE_DPAD_LEFT:
    21             return kLeft_SkKey;
    22         case AKEYCODE_DPAD_RIGHT:
    23             return kRight_SkKey;
    24         case AKEYCODE_DPAD_UP:
    25             return kUp_SkKey;
    26         case AKEYCODE_DPAD_DOWN:
    27             return kDown_SkKey;
    28         case AKEYCODE_BACK:
    29             return kBack_SkKey;
    30         default:
    31             return kNONE_SkKey;
    32     }
    33 }
    35 #endif

mercurial