Merge pull request #4775 from jmarshallnz/empty_episode_playcount
[vuplus_xbmc] / xbmc / input / XBMC_keytable.h
1 /*
2  *      Copyright (C) 2007-2013 Team XBMC
3  *      http://xbmc.org
4  *
5  *  This Program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2, or (at your option)
8  *  any later version.
9  *
10  *  This Program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with XBMC; see the file COPYING.  If not, see
17  *  <http://www.gnu.org/licenses/>.
18  *
19  */
20
21 #ifndef _XBMC_keytable_h
22 #define _XBMC_keytable_h
23
24 typedef struct struct_XBMCKEYTABLE
25 {
26
27   // The sym is a value that identifies which key was pressed. Note
28   // that it specifies the key not the character so it is unaffected by
29   // shift, control, etc.
30   uint16_t sym;
31
32   // If the keypress generates a printing character the unicode and
33   // ascii member variables contain the character generated. If the
34   // key is a non-printing character, e.g. a function or arrow key,
35   // the unicode and ascii member variables are zero.
36   uint16_t unicode;
37   char     ascii;
38
39   // The following two member variables are used to specify the
40   // action/function assigned to a key.
41   // The keynames are used as tags in keyboard.xml. When reading keyboard.xml
42   // TranslateKeyboardString uses the keyname to look up the vkey, and
43   // this is used in the mapping table.
44   uint32_t    vkey;
45   const char* keyname;
46
47 } XBMCKEYTABLE;
48
49 bool KeyTableLookupName(const char* keyname, XBMCKEYTABLE* keytable);
50 bool KeyTableLookupSym(uint16_t sym, XBMCKEYTABLE* keytable);
51 bool KeyTableLookupUnicode(uint16_t unicode, XBMCKEYTABLE* keytable);
52 bool KeyTableLookupSymAndUnicode(uint16_t sym, uint16_t unicode, XBMCKEYTABLE* keytable);
53 bool KeyTableLookupVKeyName(uint32_t vkey, XBMCKEYTABLE* keytable);
54
55 #endif /* _XBMC_keytable_h */