ScenicFramework / scenic

Core Scenic library
Apache License 2.0
1.99k stars 137 forks source link

Mouse events for buttons beyond normal 3 do not report uniquely. #258

Open crertel opened 2 years ago

crertel commented 2 years ago

Checklist

Versions and Environment

Elixir:

# elixir -v
Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]

Elixir 1.12.2 (compiled with Erlang/OTP 24)

Erlang:

# erl -v
Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]

Scenic:

# mix deps | grep scenic
* scenic 0.11.0-beta.0 (Hex package) (mix)
  locked at 0.11.0-beta.0 (scenic) cace35ef
* scenic_driver_local 0.11.0-beta.0 (Hex package) (mix)
  locked at 0.11.0-beta.0 (scenic_driver_local) 8812762a

OS:

Linux [hostname redacted] 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Steps to reproduce

Sample scene:

defmodule Example.Scene do
  @moduledoc """
  This is a minimal scene that will publish received events to the console.
  """
  use Scenic.Scene

  @input_classes [:cursor_button,
   :cursor_scroll,
   :cursor_pos]

   @impl Scenic.Scene
  def init(scene, _param, _opts) do
    :ok = request_input(scene, @input_classes)
    { :ok, scene }
  end

  @impl Scenic.Scene
  def handle_input( evt, _ctx, scene ) do
    IO.inspect(evt, label: "Input: ")
    {:noreply, scene}
  end
end

Expected Behavior

Mouse buttons that aren't left, right, or middle click should have unique button identifiers.

Actual Behavior

Mouse buttons beyond the normal three always report as :unknown.