CrystGLFW::Event::WindowCursorMove
A CrystGLFW::Event::WindowCursorMove
is generated when the system cursor is moved while a Window
has input focus. It is yielded to the block defined by on_cursor_move
.
window = Window.new
window.on_cursor_move do |event|
puts "cursor moved to #{event.position}"
end
window
You can retrieve the event's associated Window
using the window
method:
event.window # => CrystGLFW::Window
cursor
You can retrieve the Cursor
associated with the Window
using the cursor
method:
event.cursor # => CrystGLFW::Cursor
position
You can retrieve the new coordinates of the cursor using the position
method:
event.position # => {x: Float64, y: Float64}