duncan
Mom and Dad were wrong!
/home/malcolm/tmp/duncan/prototype/0/client/input.h
00001 #ifndef CLIENT_INPUT_H_
00002 #define CLIENT_INPUT_H_
00003 
00004 #include <X11/Xlib.h>
00005 #include <X11/XKBlib.h>
00006 #include <tr1/memory>
00007 #include <iostream>
00008 #include <stdexcept>
00009 #include <ncurses.h>
00010 #include "inputlistener.h"
00011 
00012 namespace client {
00013 
00022 class Input {
00023         private:
00024                 std::tr1::shared_ptr<InputListener> listener_;
00025                 Display* display_;
00026                 XEvent event_;
00027                 
00028                 bool grabbed_, repeat_;
00029 
00030                 char caps_, shift_;
00031                 unsigned int keycode_, keysym_, repeat_code_;
00032 
00033                 void grab();
00034                 void ungrab();
00035         public:
00036                 Input(std::tr1::shared_ptr<InputListener> l=std::tr1::shared_ptr<InputListener>());
00037                 ~Input();
00038 
00039                 void set_listener(std::tr1::shared_ptr<InputListener>);
00040                 void update();
00041 
00042                 static unsigned int kLeft, kRight, kUp, kDown, kEnter, kSpace, kBackspace, kCaps, kLShift, kRShift, kEscape, kF1;
00043 };
00044 
00045 } // namespace
00046 
00047 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations