Module: Teek::UI::MouseEvents Private

Defined in:
lib/teek/ui/mouse_events.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Shared mouse-event vocabulary between Handle and CanvasItem's own on_right_click, so both mean exactly the same "right click, however the platform spells it" and "these are the two things you're allowed to pop up."

Constant Summary collapse

RIGHT_CLICK_EVENTS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

A right click, however the platform spells it - the real right mouse button everywhere (++), plus macOS's two long- standing secondary-click gestures (++, and <Control-Button-1> from the one-button-mouse era) - NOT bound on other platforms, where Ctrl+click carries no such meaning (and on X11 specifically, Button-2 is the middle mouse button, a real, distinct button of its own) - binding them unconditionally there would silently fire a "right click" handler on gestures users never intended as one.

(
  Teek.platform.darwin? ? %w[<Button-2> <Button-3> <Control-Button-1>] : %w[<Button-3>]
).freeze
%i[menu context_menu].freeze