[vlc-devel] [PATCH] hotkeys: fix mouse wheel down event

Rémi Denis-Courmont remi at remlab.net
Tue Nov 27 19:37:27 CET 2018


Le tiistaina 27. marraskuuta 2018, 14.26.37 EET Victorien Le Couviour--Tuffet 
a écrit :
> ---
>  modules/control/hotkeys.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
> index 6c60deaf09..6217150f4b 100644
> --- a/modules/control/hotkeys.c
> +++ b/modules/control/hotkeys.c
> @@ -201,8 +201,11 @@ static int ButtonEvent( vlc_object_t *p_this, char
> const *psz_var,
> 
>      for (int i = MOUSE_BUTTON_WHEEL_UP; i <= MOUSE_BUTTON_WHEEL_RIGHT; i++)
> if (pressed & (1 << i))
> -            var_SetInteger(p_intf->obj.libvlc, "key-pressed",
> -                           i - MOUSE_BUTTON_WHEEL_UP + KEY_MOUSEWHEELUP);
> +        {
> +            int keycode =
> +                KEY_MOUSEWHEELUP + ((i - MOUSE_BUTTON_WHEEL_UP) << 16);
> +            var_SetInteger(p_intf->obj.libvlc, "key-pressed", keycode);
> +        }

Not sure if this is right, but even ift is, that magic number logic is too 
brittle.

> 
>      return VLC_SUCCESS;
>  }


-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/





More information about the vlc-devel mailing list