update rotation to int32 Fixed sometimes json.Unmarshal break

This commit is contained in:
vcaesar 2019-02-27 09:59:41 -04:00
parent ab3379003d
commit 4e658a4406
3 changed files with 4 additions and 3 deletions

View File

@ -52,7 +52,7 @@ void dispatch_proc(iohook_event * const event) {
break;
case EVENT_MOUSE_WHEEL:
sprintf(buffer,
"{\"id\":%i,\"time\":%" PRIu64 ",\"mask\":%hu,\"reserved\":%hu,\"clicks\":%hu,\"x\":%hd,\"y\":%hd,\"type\":%d,\"ammount\":%hu,\"rotation\":%hu,\"direction\":%d}",
"{\"id\":%i,\"time\":%" PRIu64 ",\"mask\":%hu,\"reserved\":%hu,\"clicks\":%hu,\"x\":%hd,\"y\":%hd,\"type\":%d,\"ammount\":%hu,\"rotation\":%d,\"direction\":%d}",
event->type, event->time, event->mask, event->reserved,
event->data.wheel.clicks,
event->data.wheel.x,

View File

@ -76,7 +76,7 @@ type Event struct {
Y int16 `json:"y"`
Amount uint16 `json:"amount"`
Rotation int16 `json:"rotation"`
Rotation int32 `json:"rotation"`
Direction uint8 `json:"direction"`
}

View File

@ -103,7 +103,8 @@ typedef struct _mouse_wheel_event_data {
int16_t y;
uint8_t type;
uint16_t amount;
int16_t rotation;
int32_t rotation;
// int16_t rotation;
uint8_t direction;
} mouse_wheel_event_data;