summaryrefslogtreecommitdiffstats
path: root/hw/input/ps2.c
diff options
context:
space:
mode:
authorFabian Lesniak2016-12-06 20:00:06 +0100
committerGerd Hoffmann2017-01-31 08:14:51 +0100
commit8b0caab07bf0056f44b52eb335faa45f07b7e1a6 (patch)
tree5d3463486590f086e3a6ff1217bace97474bc9ac /hw/input/ps2.c
parentqapi: add support for mice with extra/side buttons (diff)
downloadqemu-8b0caab07bf0056f44b52eb335faa45f07b7e1a6.tar.gz
qemu-8b0caab07bf0056f44b52eb335faa45f07b7e1a6.tar.xz
qemu-8b0caab07bf0056f44b52eb335faa45f07b7e1a6.zip
ps2: add support for mice with extra/side buttons
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>
Diffstat (limited to 'hw/input/ps2.c')
-rw-r--r--hw/input/ps2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 8485a4edaf..1d3a440bbd 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;