30.11.2010 - initial commit
This commit is contained in:
34
pikbdlistener.h
Normal file
34
pikbdlistener.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef PIKBDLISTENER_H
|
||||
#define PIKBDLISTENER_H
|
||||
|
||||
#include "pithread.h"
|
||||
#ifndef __WIN32__
|
||||
#include <termios.h>
|
||||
#endif
|
||||
|
||||
typedef void (*KBFunc)(void * , char);
|
||||
|
||||
class PIKbdListener: public PIThread {
|
||||
public:
|
||||
// slot is any function format "void <func>(void * , char)"
|
||||
PIKbdListener(KBFunc slot = 0, void * data = 0);
|
||||
~PIKbdListener();
|
||||
|
||||
private:
|
||||
void run();
|
||||
|
||||
KBFunc ret_func;
|
||||
char rc;
|
||||
void * data;
|
||||
#ifdef __WIN32__
|
||||
DWORD ret;
|
||||
void * hIn;
|
||||
DWORD smode;
|
||||
#else
|
||||
int ret;
|
||||
struct termios sterm;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#endif // PIKBDLISTENER_H
|
||||
Reference in New Issue
Block a user