mirror of
https://github.com/robotn/gohook.git
synced 2025-01-18 21:56:40 +08:00
update rotation to int32 Fixed sometimes json.Unmarshal break
This commit is contained in:
parent
ab3379003d
commit
4e658a4406
@ -52,7 +52,7 @@ void dispatch_proc(iohook_event * const event) {
|
|||||||
break;
|
break;
|
||||||
case EVENT_MOUSE_WHEEL:
|
case EVENT_MOUSE_WHEEL:
|
||||||
sprintf(buffer,
|
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->type, event->time, event->mask, event->reserved,
|
||||||
event->data.wheel.clicks,
|
event->data.wheel.clicks,
|
||||||
event->data.wheel.x,
|
event->data.wheel.x,
|
||||||
|
2
hook.go
2
hook.go
@ -76,7 +76,7 @@ type Event struct {
|
|||||||
Y int16 `json:"y"`
|
Y int16 `json:"y"`
|
||||||
|
|
||||||
Amount uint16 `json:"amount"`
|
Amount uint16 `json:"amount"`
|
||||||
Rotation int16 `json:"rotation"`
|
Rotation int32 `json:"rotation"`
|
||||||
Direction uint8 `json:"direction"`
|
Direction uint8 `json:"direction"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,8 @@ typedef struct _mouse_wheel_event_data {
|
|||||||
int16_t y;
|
int16_t y;
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
uint16_t amount;
|
uint16_t amount;
|
||||||
int16_t rotation;
|
int32_t rotation;
|
||||||
|
// int16_t rotation;
|
||||||
uint8_t direction;
|
uint8_t direction;
|
||||||
} mouse_wheel_event_data;
|
} mouse_wheel_event_data;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user