HID mouse: wheel
This commit is contained in:
		| @@ -152,12 +152,12 @@ def handle_my_custom_event(data): | |||||||
|     x = mouseevent['x'] |     x = mouseevent['x'] | ||||||
|     y = mouseevent['y'] |     y = mouseevent['y'] | ||||||
|     wheel = mouseevent['wheel'] |     wheel = mouseevent['wheel'] | ||||||
|  |     wheel = wheel if wheel >= 0 else 255-abs(wheel) | ||||||
|  |  | ||||||
|     print("X: {}, Y: {}".format(x, y)) |     print("X: {}, Y: {}".format(x, y)) | ||||||
|  |  | ||||||
|     hid_mouse_writeabs(btn, x, y, wheel) |     hid_mouse_writeabs(btn, x, y, wheel) | ||||||
|  |  | ||||||
|  |  | ||||||
| @app.route("/hid/keyboard", methods=["POST"]) | @app.route("/hid/keyboard", methods=["POST"]) | ||||||
| def keypress(): | def keypress(): | ||||||
|     keyevent = json.loads(request.data) |     keyevent = json.loads(request.data) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user