yaw-audio/lib/rasa/tablet.h

46 lines
781 B
C
Raw Normal View History

2022-09-22 21:55:25 +00:00
//Interface to supported tablet APIs.
#include <array>
#include <string>
typedef unsigned long ButtonMask;
#ifdef TAB_WINTAB
#include <Windows.h>
#include "MSGPACK.H"
#include "wintab.h"
typedef unsigned long ButtonMask;
#endif
struct Packet {
float x;
float y;
float z;
float p;
ButtonMask buttons;
bool operator==(const Packet& p)
{ return
this->x == p.x &&
this->y == p.y &&
this->z == p.z &&
this->p == p.p &&
this->buttons == p.buttons;
};
bool operator!=(const Packet& p) { return !(*this == p); }
};
class Tablet {
public:
Tablet(uintptr_t handle);
~Tablet();
bool GetPacket( Packet &pkt );
bool initialized;
std::string errormsg = "";
Packet ext = { 0 };
private:
#ifdef TAB_WINTAB
void NewContext(HWND hwnd);
HCTX hctx = NULL;
#endif
};