gamnit $ GamnitPointerEvent :: NATIVE
Type of thenative
underlying SDL 2 event
gamnit $ GamnitPointerEvent :: SELF
Type of this instance, automatically specialized in every classgamnit $ GamnitPointerEvent :: pressed
Is down? either going down or already downgamnit :: GamnitInputEvent :: NATIVE
Type of thenative
underlying SDL 2 event
gamnit :: GamnitInputEvent :: buffer
Native SDL 2 event buffer with the pseudo class hierarchy metadatagamnit :: GamnitInputEvent :: buffer=
Native SDL 2 event buffer with the pseudo class hierarchy metadatacore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
mnit :: InputEvent :: defaultinit
mnit :: PointerEvent :: defaultinit
core :: Object :: defaultinit
mnit :: PointerEvent :: depressed
Is it not currently pressed down? The opposite ofpressed
.
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
core :: Object :: output_class_name
Display class name on stdout (debug only).mnit :: PointerEvent :: pointer_id
Unique identifier of this pointer among other active pointersmnit :: PointerEvent :: pressed
Is down? either going down or already down
# Event on pointer, mouse and finger input
class GamnitPointerEvent
super GamnitInputEvent
super PointerEvent
redef type NATIVE: SDLMouseEvent
redef fun x do return native.x.to_f
redef fun y do return native.y.to_f
redef fun is_move do return buffer.is_mouse_motion
redef fun pressed
do
var native = native
if native isa SDLMouseButtonEvent then
return native.pressed and native.button == 1
else if native isa SDLMouseMotionEvent then
return native.state & 1 == 1
else abort
end
end
lib/gamnit/gamnit_linux.nit:131,1--151,3