class Eagle::MouseButtonEvent

Overview

A mouse button went down or up. #position is in window coordinates, and #clicks is 2 for a double-click.

Defined in:

eagle/core/events.cr

Constructors

Instance Method Summary

Instance methods inherited from class Eagle::Event

handled=(handled : Bool) handled=, handled? : Bool handled?

Constructor Detail

def self.new(button : Eagle::MouseButton, pressed : Bool, position : Eagle::Vec2, clicks : Int32 = 1) #

Creates a mouse button event.


Instance Method Detail

def button : MouseButton #

Which mouse button.


def clicks : Int32 #

1 for a single click, 2 for a double-click.


def position : Vec2 #

Mouse position in window coordinates.


def pressed? : Bool #

True for a press, false for a release.


def released? : Bool #

True when the button was released.