From 248216891b6a715a677616ee8efc971e893620c4 Mon Sep 17 00:00:00 2001 From: hippoz Date: Fri, 29 Oct 2021 04:11:15 +0300 Subject: [PATCH] add experimental scrolling --- capybara | 8 +++++++ public/index.html | 60 +++++++++++++++++++++++++++++++++++++---------- 2 files changed, 55 insertions(+), 13 deletions(-) diff --git a/capybara b/capybara index eb90ea6..7eca512 100755 --- a/capybara +++ b/capybara @@ -51,6 +51,11 @@ class InputController(): "x": "int", "y": "int" }) + # Mouse relative scroll + self.parser.add_handler("s", { + "x": "int", + "y": "int" + }) # Mouse button down self.parser.add_handler("d", { "button": "int" @@ -82,6 +87,9 @@ class InputController(): elif code == "u": print("u", args["button"]) self.mouse_controller.release(self.button_code_to_object(args["button"])) + elif code == "s": + print("s", args["x"], args["y"]) + self.mouse_controller.scroll(args["x"], args["y"]) else: print("got invalid code from parser (is this a bug with the MessageParser?)") return False diff --git a/public/index.html b/public/index.html index 5fae6cb..51c5c9e 100644 --- a/public/index.html +++ b/public/index.html @@ -6,8 +6,10 @@ Document