Class ScrollEvent
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeInstance
org.gnome.gdk.Event
org.gnome.gdk.ScrollEvent
- All Implemented Interfaces:
Proxy
An event related to a scrolling motion.
-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Event$Impl -
Constructor Summary
ConstructorsConstructorDescriptionScrollEvent(MemorySegment address) Create a ScrollEvent instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected ScrollEventasParent()Return this instance as if it were its parent type.voidExtracts the scroll deltas of a scroll event.Extracts the direction of a scroll event.static MemoryLayoutThe memory layout of the native struct.Extracts the scroll direction relative to the physical motion.static @Nullable TypegetType()Get the GType of the ScrollEvent class.getUnit()Extracts the scroll delta unit of a scroll event.booleanisStop()Check whether a scroll event is a stop scroll event.Methods inherited from class Event
eventsGetAngle, eventsGetCenter, eventsGetDistance, getAxes, getAxis, getDevice, getDeviceTool, getDisplay, getEventSequence, getEventType, getHistory, getModifierState, getPointerEmulated, getPosition, getSeat, getSurface, getTime, ref, triggersContextMenu, unrefMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
ScrollEvent
Create a ScrollEvent instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
getDeltas
Extracts the scroll deltas of a scroll event.
The deltas will be zero unless the scroll direction is
ScrollDirection.SMOOTH.For the representation unit of these deltas, see
getUnit().- Parameters:
deltaX- return location for x scroll deltadeltaY- return location for y scroll delta
-
getDirection
Extracts the direction of a scroll event.- Returns:
- the scroll direction of this ScrollEvent
-
getRelativeDirection
Extracts the scroll direction relative to the physical motion.- Returns:
- the relative scroll direction.
- Since:
- 4.20
-
getUnit
Extracts the scroll delta unit of a scroll event.
The unit will always be
ScrollUnit.WHEELif the scroll direction is notScrollDirection.SMOOTH.- Returns:
- the scroll unit.
- Since:
- 4.8
-
isStop
public boolean isStop()Check whether a scroll event is a stop scroll event.
Scroll sequences with smooth scroll information may provide a stop scroll event once the interaction with the device finishes, e.g. by lifting a finger. This stop scroll event is the signal that a widget may trigger kinetic scrolling based on the current velocity.
Stop scroll events always have a delta of 0/0.
- Returns:
trueif the event is a scroll stop event
-