2010-08-09 13:28:56 +00:00
|
|
|
#include <sys/ipc.h>
|
|
|
|
#include <sys/shm.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/Xutil.h>
|
|
|
|
#include <X11/Xatom.h>
|
|
|
|
|
|
|
|
namespace ruby {
|
|
|
|
|
|
|
|
class pInputX {
|
|
|
|
public:
|
|
|
|
Display *display;
|
|
|
|
#include "xlibkeys.hpp"
|
|
|
|
|
|
|
|
bool cap(const string& name) {
|
|
|
|
if(name == Input::KeyboardSupport) return true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
any get(const string& name) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool set(const string& name, const any &value) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool acquire() { return false; }
|
|
|
|
bool unacquire() { return false; }
|
|
|
|
bool acquired() { return false; }
|
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
bool poll(int16_t* table) {
|
2010-08-09 13:28:56 +00:00
|
|
|
memset(table, 0, Scancode::Limit * sizeof(int16_t));
|
2011-08-12 12:33:07 +00:00
|
|
|
x_poll(display, table);
|
2010-08-09 13:28:56 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool init() {
|
|
|
|
display = XOpenDisplay(0);
|
2011-08-12 12:33:07 +00:00
|
|
|
x_init(display);
|
2010-08-09 13:28:56 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void term() {
|
|
|
|
XCloseDisplay(display);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
DeclareInput(X)
|
|
|
|
|
|
|
|
};
|