struct CrystGLFW::Event::WindowMouseButton
- CrystGLFW::Event::WindowMouseButton
- CrystGLFW::Event::Any
- Struct
- Value
- Object
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.crInstance Method Summary
- #mouse_button : MouseButton
-
#press?
Returns true if the mouse button was pressed.
-
#release?
Returns true if the mouse button was released.
- #window : CrystGLFW::Window
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 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
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