From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Fabian Lesniak <fabian@lesniak-it.de>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 02/10] ps2: add support for mice with extra/side buttons
Date: Tue, 31 Jan 2017 14:41:38 +0100 [thread overview]
Message-ID: <1485870106-25016-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1485870106-25016-1-git-send-email-kraxel@redhat.com>
From: Fabian Lesniak <fabian@lesniak-it.de>
This enables the ps2 controller to process mouse events for buttons 4 and 5.
Additionally, distinct definitions for the ps2 mouse button state are
introduced. The legacy definitions from console.h are not used anymore.
Signed-off-by: Fabian Lesniak <fabian@lesniak-it.de>
Message-id: 20161206190007.7539-3-fabian@lesniak-it.de
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/input/ps2.c | 8 +++++---
include/hw/input/ps2.h | 6 ++++++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 8485a4e..1d3a440 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -881,9 +881,11 @@ static void ps2_mouse_event(DeviceState *dev, QemuConsole *src,
InputEvent *evt)
{
static const int bmap[INPUT_BUTTON__MAX] = {
- [INPUT_BUTTON_LEFT] = MOUSE_EVENT_LBUTTON,
- [INPUT_BUTTON_MIDDLE] = MOUSE_EVENT_MBUTTON,
- [INPUT_BUTTON_RIGHT] = MOUSE_EVENT_RBUTTON,
+ [INPUT_BUTTON_LEFT] = PS2_MOUSE_BUTTON_LEFT,
+ [INPUT_BUTTON_MIDDLE] = PS2_MOUSE_BUTTON_MIDDLE,
+ [INPUT_BUTTON_RIGHT] = PS2_MOUSE_BUTTON_RIGHT,
+ [INPUT_BUTTON_SIDE] = PS2_MOUSE_BUTTON_SIDE,
+ [INPUT_BUTTON_EXTRA] = PS2_MOUSE_BUTTON_EXTRA,
};
PS2MouseState *s = (PS2MouseState *)dev;
InputMoveEvent *move;
diff --git a/include/hw/input/ps2.h b/include/hw/input/ps2.h
index b9ceee4..0fec91c 100644
--- a/include/hw/input/ps2.h
+++ b/include/hw/input/ps2.h
@@ -25,6 +25,12 @@
#ifndef HW_PS2_H
#define HW_PS2_H
+#define PS2_MOUSE_BUTTON_LEFT 0x01
+#define PS2_MOUSE_BUTTON_MIDDLE 0x02
+#define PS2_MOUSE_BUTTON_RIGHT 0x04
+#define PS2_MOUSE_BUTTON_SIDE 0x08
+#define PS2_MOUSE_BUTTON_EXTRA 0x10
+
/* ps2.c */
void *ps2_kbd_init(void (*update_irq)(void *, int), void *update_arg);
void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg);
--
1.8.3.1
next prev parent reply other threads:[~2017-01-31 13:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-31 13:41 [Qemu-devel] [PULL 00/10] ui patch queue Gerd Hoffmann
2017-01-31 13:41 ` [Qemu-devel] [PULL 01/10] qapi: add support for mice with extra/side buttons Gerd Hoffmann
2017-01-31 13:41 ` Gerd Hoffmann [this message]
2017-01-31 13:41 ` [Qemu-devel] [PULL 03/10] ui: " Gerd Hoffmann
2017-01-31 13:41 ` [Qemu-devel] [PULL 04/10] vnc: track LED state separately Gerd Hoffmann
2017-01-31 13:41 ` [Qemu-devel] [PULL 05/10] ui/gtk: Fix mouse wheel on 3.4.0 or later Gerd Hoffmann
2017-01-31 13:41 ` [Qemu-devel] [PULL 06/10] ui: fix format specfier in vnc to avoid break in build Gerd Hoffmann
2017-01-31 13:41 ` [Qemu-devel] [PULL 07/10] ui/gtk.c: add ctrl-alt-= support for zoom in acceleration Gerd Hoffmann
2017-01-31 13:41 ` [Qemu-devel] [PULL 08/10] spice: wakeup QXL worker to pick up mouse changes Gerd Hoffmann
2017-01-31 13:41 ` [Qemu-devel] [PULL 09/10] vnc: fix overflow in vnc_update_stats Gerd Hoffmann
2017-01-31 13:41 ` [Qemu-devel] [PULL 10/10] gtk: Hardcode LC_CTYPE as C.utf-8 Gerd Hoffmann
2017-01-31 14:00 ` [Qemu-devel] [PULL 00/10] ui patch queue Eric Blake
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=1485870106-25016-3-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=fabian@lesniak-it.de \
--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).