Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

keyboard_x11.h

Go to the documentation of this file.
00001 /*
00002         $Id: keyboard_x11.h,v 1.2 2001/03/15 12:14:46 mbn Exp $
00003 
00004         ------------------------------------------------------------------------
00005         ClanLib, the platform independent game SDK.
00006 
00007         This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00008         version 2. See COPYING for details.
00009 
00010         For a total list of contributers see CREDITS.
00011 
00012         ------------------------------------------------------------------------
00013 */
00014 
00015 #ifndef header_keyboard_x11
00016 #define header_keyboard_x11
00017 
00018 #ifdef USE_X11
00019 
00020 #include "API/Display/Input/inputbutton.h"
00021 #include "API/Display/Input/keyboard.h"
00022 #include "Core/System/Unix/init_linux.h"
00023 #include "API/Core/System/keep_alive.h"
00024 #include "API/signals.h"
00025 
00026 // Don't change this; hardcoded in X
00027 #define X_KEYBOARD_BUFFERSIZE 32
00028 
00029 class CL_InputButton_XKeyboard : public CL_InputButton
00030 {
00031 public:
00032         CL_InputButton_XKeyboard(int key, char *keys_return);
00033         virtual bool is_pressed();
00034 
00035 private:
00036         int key;
00037         char *keys_return;
00038 };
00039 
00040 class CL_XWindow_CompatibleCard;
00041 class CL_XWindowKeyboard : public CL_Keyboard, CL_KeepAlive
00042 {
00043 public:
00044         CL_XWindowKeyboard(CL_XWindow_CompatibleCard *card);
00045         virtual ~CL_XWindowKeyboard();
00046 
00047         virtual char *get_name() const;
00048 
00049         virtual int get_num_buttons() const;
00050         virtual CL_InputButton *get_button(int button_num);
00051 
00052         virtual int get_num_axes() const;
00053         virtual CL_InputAxis *get_axis(int axis_num);
00054 
00055         virtual int get_num_hats() const;
00056         virtual CL_InputHat *get_hat(int hat_num);
00057 
00058         virtual int get_num_cursors() const;
00059         virtual CL_InputCursor *get_cursor(int cursor_num);
00060 
00061         virtual void keep_alive();
00062 
00063 private:
00064         static int map_keysym_to_id(int keysym);
00065         static int map_id_to_keysym(int id);
00066         
00067         void on_xevent(XEvent &event);
00068         CL_Slot slot_xevent;
00069 
00070         char keys_return[X_KEYBOARD_BUFFERSIZE];
00071         
00072         CL_InputButton_XKeyboard **buttons;
00073         CL_XWindow_CompatibleCard *card;
00074 };
00075 
00076 #endif /* USE_X11 */
00077 
00078 #endif

Generated at Wed Apr 4 19:54:01 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001