chiark / gitweb /
wip support hatswitch properly, rather than as a valloc - abortive edits, one commit... copy.wip.hidrawconv-hat
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 12 Feb 2011 13:03:30 +0000 (13:03 +0000)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 12 Feb 2011 13:03:30 +0000 (13:03 +0000)
hostside/hidrawconv.c
hostside/hidrawconv.h

index 738a153be5740c9b5fec1f5d43704c14b4820398..5e5bfa4fdfbc31038ad89c0e481db17f73ded87d 100644 (file)
@@ -41,7 +41,10 @@ void reportlocs(const uint8_t msg[], const uint8_t last[],
     printf("%s %d\n", loc->str, loc->sign * (int8_t)mb);
   }
 }
-  
+
+void reporthat(const uint8_t msg[], const uint8_t last[], int len,
+              
+
 static void events(void) {
   uint8_t msg[MAXREPORTLEN];
   for (;;) {
index 9e34f780997fed5f3e684d79ddec8a45a6bcbcdf..9f5a3aba59f94032e8320970cb1cd2423c1a79d7 100644 (file)
@@ -27,6 +27,17 @@ typedef struct {
   uint8_t mask, zero;
 } ValLoc;
 
+typedef struct {
+  int x, y;
+} HatPosn;
+
+typedef struct {
+  const char *base;
+  int pos, rshift, max; /* mask is applied before rshift */
+  uint8_t mask;
+  const HatPosn[
+} HatLoc;
+
 void reportbits(const uint8_t msg[], const uint8_t last[],
                int len, const KeyBit bits[]);