home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 February / maximum-cd-2009-02.iso / DiscContents / SMC_1.6_win32.exe / src / input / keyboard.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-08-12  |  2.1 KB  |  76 lines

  1. /***************************************************************************
  2.  * keyboard.h  -  header for the corresponding cpp file
  3.  *
  4.  * Copyright (C) 2003 - 2008 Florian Richter
  5.  ***************************************************************************/
  6. /*
  7.    This program is free software; you can redistribute it and/or modify
  8.    it under the terms of the GNU General Public License as published by
  9.    the Free Software Foundation; either version 3 of the License, or
  10.    (at your option) any later version.
  11.    
  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  14. */
  15.  
  16. #ifndef SMC_KEYBOARD_H
  17. #define SMC_KEYBOARD_H
  18.  
  19. #include "../core/globals.h"
  20.  
  21. /* *** *** *** *** *** *** *** *** cKeyboard *** *** *** *** *** *** *** *** *** */
  22.  
  23. class cKeyboard
  24. {
  25. public:
  26.     cKeyboard( void );
  27.     ~cKeyboard( void );
  28.  
  29.     // Reset all keys
  30.     void Reset_Keys( void );
  31.  
  32.     /* Function : CEGUI_Handle_KeyUp
  33.      * CEGUI Key Up handler
  34.      * returns true if CEGUI processed the given key up event
  35.     */
  36.     bool CEGUI_Handle_Key_Up( SDLKey key );
  37.  
  38.     /* Function : KeyUp
  39.      * Gives player various cues depending on the key
  40.      * returns true if the event was processed
  41.     */
  42.     bool Key_Up( SDLKey key );
  43.  
  44.     /* Function : CEGUI_Handle_KeyDown
  45.      * CEGUI Key Down handler
  46.      * returns true if CEGUI processed the given key down event
  47.     */
  48.     bool CEGUI_Handle_Key_Down( SDLKey key );
  49.  
  50.     /* Function : KeyDown
  51.      * Key Down handler
  52.      * returns true if the event was processed
  53.     */
  54.     bool Key_Down( SDLKey key );
  55.  
  56.     // Get the assigned shortcut
  57.     SDLKey *Get_Shortcut( input_identifier shortcut_id );
  58.     // Assign a shortcut
  59.     void Assign_Shortcut( input_identifier shortcut_id, SDLKey new_key );
  60.  
  61.     // Translate a SDLKey to the proper CEGUI::Key
  62.     unsigned int SDLKey_to_CEGUIKey( SDLKey key );
  63.  
  64.     // Pressed keys
  65.     Uint8 keys[SDLK_LAST];
  66. };
  67.  
  68. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  69.  
  70. // global Keyboard pointer
  71. extern cKeyboard *pKeyboard;
  72.  
  73. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  74.  
  75. #endif
  76.