From efb2c1fced80d7bd8ed793a4361779c1cdd0c487 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 12 Feb 2011 13:03:30 +0000 Subject: [PATCH] wip support hatswitch properly, rather than as a valloc - abortive edits, one commit only on this branch atm --- hostside/hidrawconv.c | 5 ++++- hostside/hidrawconv.h | 11 +++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/hostside/hidrawconv.c b/hostside/hidrawconv.c index 738a153..5e5bfa4 100644 --- a/hostside/hidrawconv.c +++ b/hostside/hidrawconv.c @@ -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 (;;) { diff --git a/hostside/hidrawconv.h b/hostside/hidrawconv.h index 9e34f78..9f5a3ab 100644 --- a/hostside/hidrawconv.h +++ b/hostside/hidrawconv.h @@ -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[]); -- 2.30.2