struct CrystGLFW::Event::WindowMouseButton

Overview

A WindowMouseButtonEvent is generated by the Window#on_mouse_button callback and contains a MouseButton along with an interface to determine what action occurred with the key.

Included Modules

Defined in:

crystglfw/events/window_mouse_button.cr

Instance Method Summary

Instance methods inherited from module CrystGLFW::Event::Modifiers

alt? alt?, control? control?, shift? shift?, super? super?

Constructor methods inherited from struct CrystGLFW::Event::Any

new new

Instance Method Detail

def mouse_button : MouseButton #

[View source]
def press? #

Returns true if the mouse button was pressed. False otherwise.

window.on_mouse_button do |event|
  puts "a mouse button was pressed." if event.press?
end

[View source]
def release? #

Returns true if the mouse button was released. False otherwise.

window.on_mouse_button do |event|
  puts "a mouse button was released." if event.release?
end

[View source]
def window : CrystGLFW::Window #

[View source]