All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@gmail.com>
To: Dmitry Petrov <dpetroff@gmail.com>
Cc: QEMU <qemu-devel@nongnu.org>
Subject: Re: [PATCH v2 5/5] ui/input-legacy: pass horizontal scroll information
Date: Wed, 22 Dec 2021 17:10:43 +0400	[thread overview]
Message-ID: <CAJ+F1CKgN7G5f452c8b7T-nHJ24zx4CgtemdAqmh4utUPw_PkA@mail.gmail.com> (raw)
In-Reply-To: <20211222010647.1332479-5-dpetroff@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2507 bytes --]

Hi

On Wed, Dec 22, 2021 at 5:31 AM Dmitry Petrov <dpetroff@gmail.com> wrote:

> 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>
>

Hmm, apparently Linux kernel handles PSMOUSE_VMMOUSE as a generic ps/2
mouse without the extensions.

And there is no horizontal scrolling in vmmouse protocol I can find.

---
>  ui/input-legacy.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/ui/input-legacy.c b/ui/input-legacy.c
> index 9fc78a639b..2c9a215d7f 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);
> +        }
>

So I think mapping to vertical makes sense, although I am not sure it's
necessary.

         break;
>      case INPUT_EVENT_KIND_ABS:
>          move = evt->u.abs.data;
> @@ -216,6 +231,7 @@ QEMUPutMouseEntry
> *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func,
>      QEMUPutMouseEntry *s;
>
>      s = g_new0(QEMUPutMouseEntry, 1);
> +    qemu_log("qemu_add_mouse_event_handler %s", name);
>
>
Please remove that logging


>      s->qemu_put_mouse_event = func;
>      s->qemu_put_mouse_event_opaque = opaque;
> --
> 2.32.0
>
>
>

-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 3953 bytes --]

  reply	other threads:[~2021-12-22 13:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22  1:06 [PATCH v2 1/5] ps2: Initial horizontal scroll support Dmitry Petrov
2021-12-22  1:06 ` [PATCH v2 2/5] ui/cocoa: pass horizontal scroll information to the device code Dmitry Petrov
2021-12-22  1:06 ` [PATCH v2 3/5] ui/gtk: " Dmitry Petrov
2021-12-22  1:06 ` [PATCH v2 4/5] ui/sdl2: " Dmitry Petrov
2021-12-22  1:06 ` [PATCH v2 5/5] ui/input-legacy: pass horizontal scroll information Dmitry Petrov
2021-12-22 13:10   ` Marc-André Lureau [this message]
2021-12-22 13:59 ` [PATCH v2 1/5] ps2: Initial horizontal scroll support Marc-André Lureau
2021-12-22 15:10   ` Dmitry Petrov
2021-12-22 19:50     ` Marc-André Lureau
2022-01-04 13:30 ` Daniel P. Berrangé
2022-01-08 15:42   ` Dmitry Petrov

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=CAJ+F1CKgN7G5f452c8b7T-nHJ24zx4CgtemdAqmh4utUPw_PkA@mail.gmail.com \
    --to=marcandre.lureau@gmail.com \
    --cc=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 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.