From: Dmitry Petrov <dpetroff@gmail.com>
To: qemu-devel@nongnu.org
Cc: Dmitry Petrov <dpetroff@gmail.com>
Subject: [PATCH v3 5/5] ui/input-legacy: pass horizontal scroll information
Date: Wed, 22 Dec 2021 23:56:06 +0100 [thread overview]
Message-ID: <20211222225606.1359162-6-dpetroff@gmail.com> (raw)
In-Reply-To: <20211222225606.1359162-1-dpetroff@gmail.com>
This code seems to be used by vmport hack, passing these values allows
to implement horizontal scroll support even when using vmport.
In case it's not supported horizontal scroll will act as a vertical one.
Signed-off-by: Dmitry Petrov <dpetroff@gmail.com>
---
ui/input-legacy.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/ui/input-legacy.c b/ui/input-legacy.c
index 9fc78a639b..46ea74e44d 100644
--- a/ui/input-legacy.c
+++ b/ui/input-legacy.c
@@ -23,6 +23,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/log.h"
#include "qapi/qapi-commands-ui.h"
#include "ui/console.h"
#include "keymaps.h"
@@ -179,6 +180,20 @@ static void legacy_mouse_event(DeviceState *dev, QemuConsole *src,
1,
s->buttons);
}
+ if (btn->down && btn->button == INPUT_BUTTON_WHEEL_RIGHT) {
+ s->qemu_put_mouse_event(s->qemu_put_mouse_event_opaque,
+ s->axis[INPUT_AXIS_X],
+ s->axis[INPUT_AXIS_Y],
+ -2,
+ s->buttons);
+ }
+ if (btn->down && btn->button == INPUT_BUTTON_WHEEL_LEFT) {
+ s->qemu_put_mouse_event(s->qemu_put_mouse_event_opaque,
+ s->axis[INPUT_AXIS_X],
+ s->axis[INPUT_AXIS_Y],
+ 2,
+ s->buttons);
+ }
break;
case INPUT_EVENT_KIND_ABS:
move = evt->u.abs.data;
--
2.32.0
prev parent reply other threads:[~2021-12-22 23:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-22 22:56 [PATCH v3 0/5] Add horizontal mouse scroll support Dmitry Petrov
2021-12-22 22:56 ` [PATCH v3 1/5] ps2: Initial horizontal " Dmitry Petrov
2021-12-22 22:56 ` [PATCH v3 2/5] ui/cocoa: pass horizontal scroll information to the device code Dmitry Petrov
2021-12-22 22:56 ` [PATCH v3 3/5] ui/gtk: " Dmitry Petrov
2021-12-22 22:56 ` [PATCH v3 4/5] ui/sdl2: " Dmitry Petrov
2021-12-22 22:56 ` Dmitry Petrov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211222225606.1359162-6-dpetroff@gmail.com \
--to=dpetroff@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).