class SFML::Event

A window event. Holds a type symbol and a Hash of type-specific data. Pattern-match it directly; that’s the intended interface:

case event in {type: :closed} then … in {type: :key_pressed, code: :escape} then … in {type: :resized, size:} then … in {type: :mouse_moved, position: {x:, y:}} then … in {type: :mouse_wheel_scrolled, delta:} then … end

Type-specific fields are also reachable as plain methods (event.code, event.position) for the cases when pattern matching is overkill.