All of lore.kernel.org
 help / color / mirror / Atom feed
From: sL1pKn07 SpinFlo <sl1pkn07@gmail.com>
To: kraxel@redhat.com
Cc: qemu-devel@nongnu.org, vfio-users <vfio-users@redhat.com>
Subject: [Qemu-devel] Fwd: [vfio-users] [PATCH v2 1/3] input: add qemu_input_qcode_to_linux + qemu_input_linux_to_qcode
Date: Fri, 15 Jan 2016 19:04:27 +0100	[thread overview]
Message-ID: <CAAaYXTtYq2GP+vPWQkqexDP9Dd51NgHxiVtpTwFmt1Rh3PKp1A@mail.gmail.com> (raw)
In-Reply-To: <CAAaYXTuX0qzgwqF0TWoVQ1zBKcNOWDEVUjat8Pe5XzP4PhHifw@mail.gmail.com>

---------- Forwarded message ----------
From: sL1pKn07 SpinFlo <sl1pkn07@gmail.com>
Date: 2016-01-15 13:48 GMT+01:00
Subject: Re: [vfio-users] [PATCH v2 1/3] input: add
qemu_input_qcode_to_linux + qemu_input_linux_to_qcode
To: Gerd Hoffmann <kraxel@redhat.com>


2016-01-15 9:50 GMT+01:00 Gerd Hoffmann <kraxel@redhat.com>:
> The mouse emulated by qemu has only three buttons.
>
> cheers,
>   Gerd
>

mmmnnn

---------------------------------------------------------------------------------------------------------

diff --git a/hw/input/hid.c b/hw/input/hid.c
index 3221d29..4dc870d 100644
--- a/hw/input/hid.c
+++ b/hw/input/hid.c
@@ -109,9 +109,13 @@ static void hid_pointer_event(DeviceState *dev,
QemuConsole *src,
                               InputEvent *evt)
 {
     static const int bmap[INPUT_BUTTON__MAX] = {
-        [INPUT_BUTTON_LEFT]   = 0x01,
-        [INPUT_BUTTON_RIGHT]  = 0x02,
-        [INPUT_BUTTON_MIDDLE] = 0x04,
+        [INPUT_BUTTON_LEFT]       = 0x01,
+        [INPUT_BUTTON_RIGHT]      = 0x02,
+        [INPUT_BUTTON_MIDDLE]     = 0x04,
+        [INPUT_BUTTON_WHELLLEFT]  = 0x??, /* FIXME! */
+        [INPUT_BUTTON_WHELLRIGHT] = 0x??, /* FIXME! */
+        [INPUT_BUTTON_FN1]        = 0x??, /* FIXME! */
+        [INPUT_BUTTON_FN2]        = 0x??, /* FIXME! */
     };
     HIDState *hs = (HIDState *)dev;
     HIDPointerEvent *e;
diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 79754cd..2e5a722 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -383,9 +383,13 @@ 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]       = MOUSE_EVENT_LBUTTON,
+        [INPUT_BUTTON_MIDDLE]     = MOUSE_EVENT_MBUTTON,
+        [INPUT_BUTTON_RIGHT]      = MOUSE_EVENT_RBUTTON,
+        [INPUT_BUTTON_WHELLLEFT]  = MOUSE_EVENT_WLBUTTON,
+        [INPUT_BUTTON_WHELLRIGHT] = MOUSE_EVENT_WRRBUTTON,
+        [INPUT_BUTTON_FN1]        = MOUSE_EVENT_FN1BUTTON,
+        [INPUT_BUTTON_FN2]        = MOUSE_EVENT_FN2BUTTON,
     };
     PS2MouseState *s = (PS2MouseState *)dev;

diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c
index a78d11c..9e3b6dd 100644
--- a/hw/input/virtio-input-hid.c
+++ b/hw/input/virtio-input-hid.c
@@ -144,6 +144,10 @@ static const unsigned int
keymap_button[INPUT_BUTTON__MAX] = {
     [INPUT_BUTTON_MIDDLE]            = BTN_MIDDLE,
     [INPUT_BUTTON_WHEELUP]           = BTN_GEAR_UP,
     [INPUT_BUTTON_WHEELDOWN]         = BTN_GEAR_DOWN,
+    [INPUT_BUTTON_WHELLLEFT]         = BTN_GEAR_LEFT,
+    [INPUT_BUTTON_WHELLRIGHT]        = BTN_GEAR_RIGHT,
+    [INPUT_BUTTON_FN1]               = BTN_FUNCTION_1,
+    [INPUT_BUTTON_FN2]               = BTN_FUNCTION_2,
 };

 static const unsigned int axismap_rel[INPUT_AXIS__MAX] = {
diff --git a/include/standard-headers/linux/input-event-codes.h
b/include/standard-headers/linux/input-event-codes.h
index 354f0de..0df11c7 100644
--- a/include/standard-headers/linux/input-event-codes.h
+++ b/include/standard-headers/linux/input-event-codes.h
@@ -416,6 +416,11 @@
 #define BTN_WHEEL 0x150
 #define BTN_GEAR_DOWN 0x150
 #define BTN_GEAR_UP 0x151
+#define BTN_GEAR_LEFT 0x???   /* FIXME! */
+#define BTN_GEAR_RIGHT 0x???   /* FIXME! */
+#define BTN_FUNCTION_1 0x???   /* FIXME! */
+#define BTN_FUNCTION_2 0x???   /* FIXME! */
+

 #define KEY_OK 0x160
 #define KEY_SELECT 0x161
diff --git a/monitor.c b/monitor.c
index e7e7ae2..beda8da 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1390,6 +1390,10 @@ static void hmp_mouse_button(Monitor *mon,
const QDict *qdict)
         [INPUT_BUTTON_LEFT]       = MOUSE_EVENT_LBUTTON,
         [INPUT_BUTTON_MIDDLE]     = MOUSE_EVENT_MBUTTON,
         [INPUT_BUTTON_RIGHT]      = MOUSE_EVENT_RBUTTON,
+        [INPUT_BUTTON_WHELLLEFT]  = MOUSE_EVENT_WLBUTTON,
+        [INPUT_BUTTON_WHELLRIGHT] = MOUSE_EVENT_WRRBUTTON,
+        [INPUT_BUTTON_FN1]        = MOUSE_EVENT_FN1BUTTON,
+        [INPUT_BUTTON_FN2]        = MOUSE_EVENT_FN2BUTTON,
     };
     int button_state = qdict_get_int(qdict, "button_state");

diff --git a/ui/input-linux.c b/ui/input-linux.c
index 2e92c21..cc23c96 100644
--- a/ui/input-linux.c
+++ b/ui/input-linux.c
@@ -212,6 +212,17 @@ static void input_linux_event_mouse(void *opaque)
             case BTN_GEAR_DOWN:
                 qemu_input_queue_btn(NULL, INPUT_BUTTON_WHEELDOWN,
                                      event.value);
+            case BTN_GEAR_LEFT:
+                qemu_input_queue_btn(NULL, INPUT_BUTTON_WHELLLEFT,
+                                     event.value);
+            case BTN_GEAR_RIGHT:
+                qemu_input_queue_btn(NULL, INPUT_BUTTON_WHELLRIGHT,
+                                     event.value);
+            case BTN_FUNCTION_1:
+                qemu_input_queue_btn(NULL, INPUT_BUTTON_FN1, event.value);
+                break;
+            case BTN_FUNCTION_1:
+                qemu_input_queue_btn(NULL, INPUT_BUTTON_FN2, event.value);
                 break;
             };
             break;
---------------------------------------------------------------------------------------------------------

for add more buttons is something like this?

how I can get the values of "FIXME" parameters?

yes, is a ugly patch (i am not coder) and make only for me... but i
not want back to synergy/usb passthrough :(

greetings


PS: Mailman, oh, please ¬¬

  parent reply	other threads:[~2016-01-15 18:05 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14 14:18 [Qemu-devel] [PATCH v2 1/3] input: add qemu_input_qcode_to_linux + qemu_input_linux_to_qcode Gerd Hoffmann
2015-12-14 14:18 ` [Qemu-devel] [PATCH v2 2/3] input: linux evdev support Gerd Hoffmann
2015-12-14 16:44   ` [Qemu-devel] [vfio-users] " thibaut noah
2015-12-14 14:18 ` [Qemu-devel] [PATCH v2 3/3] input-linux: add option to toggle grab on all devices Gerd Hoffmann
2016-01-04 10:10 ` [Qemu-devel] [vfio-users] [PATCH v2 1/3] input: add qemu_input_qcode_to_linux + qemu_input_linux_to_qcode Jonathan Scruggs
2016-01-04 11:56   ` Gerd Hoffmann
2016-01-04 13:13     ` Jonathan Scruggs
2016-01-04 13:19     ` Jonathan Scruggs
     [not found]       ` <CAAaYXTufBXAyrc0tNkOmRWZ6qmGW5qpyfAfjmOnRsHpgi4H1YA@mail.gmail.com>
2016-01-05  2:24         ` [Qemu-devel] Fwd: " sL1pKn07 SpinFlo
2016-01-05  7:05       ` [Qemu-devel] " Gerd Hoffmann
2016-01-05  8:06         ` Jonathan Scruggs
2016-01-05 14:44           ` sL1pKn07 SpinFlo
2016-01-06  7:53             ` Gerd Hoffmann
     [not found]               ` <CAAaYXTvQJmgZEz8AUfe5GNULcbpN7TA8DdCNDFxD4yZKAju=kg@mail.gmail.com>
2016-01-07  4:55                 ` [Qemu-devel] Fwd: " sL1pKn07 SpinFlo
     [not found]                 ` <1452087192.6096.38.camel@redhat.com>
2016-01-07  4:57                   ` sL1pKn07 SpinFlo
2016-01-13 20:34                     ` [Qemu-devel] " sL1pKn07 SpinFlo
2016-01-14 23:19                       ` sL1pKn07 SpinFlo
2016-01-15  8:50                         ` Gerd Hoffmann
     [not found]                           ` <CAAaYXTuX0qzgwqF0TWoVQ1zBKcNOWDEVUjat8Pe5XzP4PhHifw@mail.gmail.com>
2016-01-15 18:04                             ` sL1pKn07 SpinFlo [this message]
     [not found]                             ` <1452864264.23156.72.camel@redhat.com>
2016-01-15 18:06                               ` [Qemu-devel] Fwd: " sL1pKn07 SpinFlo
2016-01-15 18:14                                 ` [Qemu-devel] " sL1pKn07 SpinFlo
2016-01-18 11:47                           ` Jonathan Scruggs
2016-01-18 14:13                             ` Gerd Hoffmann
2016-01-23 21:51                               ` Jonathan Scruggs
2016-01-25  8:13                                 ` Gerd Hoffmann
2016-01-24 15:06                               ` Jonathan Scruggs
2016-01-25  8:29                                 ` Gerd Hoffmann
     [not found]     ` <CAAaYXTty+R2DJ3=Uc3K3xJ+iTNEHdA4JE1_iWXdL=U3sPwqjZw@mail.gmail.com>
2016-01-05  2:26       ` sL1pKn07 SpinFlo
2016-01-05  7:06         ` Gerd Hoffmann
     [not found]   ` <CAAaYXTvaDntkeSOKvu12UwT4FeAkspM12q94GE=keRTn-NOUsQ@mail.gmail.com>
2016-01-05  2:27     ` sL1pKn07 SpinFlo

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=CAAaYXTtYq2GP+vPWQkqexDP9Dd51NgHxiVtpTwFmt1Rh3PKp1A@mail.gmail.com \
    --to=sl1pkn07@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vfio-users@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.