| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Gdk.Objects.Event
Description
The GdkEvent struct contains only private fields and should not be accessed directly.
Synopsis
- newtype Event = Event (ManagedPtr Event)
- class (BoxedPtr o, TypedObject o, IsDescendantOf Event o) => IsEvent o
- toEvent :: (MonadIO m, IsEvent o) => o -> m Event
- eventGetAxes :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, [Double])
- eventGetAxis :: (HasCallStack, MonadIO m, IsEvent a) => a -> AxisUse -> m (Bool, Double)
- eventGetDevice :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Maybe Device)
- eventGetDeviceTool :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Maybe DeviceTool)
- eventGetDisplay :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Maybe Display)
- eventGetEventSequence :: (HasCallStack, MonadIO m, IsEvent a) => a -> m EventSequence
- eventGetEventType :: (HasCallStack, MonadIO m, IsEvent a) => a -> m EventType
- eventGetModifierState :: (HasCallStack, MonadIO m, IsEvent a) => a -> m [ModifierType]
- eventGetPointerEmulated :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Bool
- eventGetPosition :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Double, Double)
- eventGetSourceDevice :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Maybe Device)
- eventGetSurface :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Surface
- eventGetTime :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Word32
- eventRef :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Event
- eventTriggersContextMenu :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Bool
- eventUnref :: (HasCallStack, MonadIO m, IsEvent a) => a -> m ()
Exported types
Memory-managed wrapper type.
Constructors
| Event (ManagedPtr Event) |
Instances
| Eq Event Source # | |
| ManagedPtrNewtype Event Source # | |
Defined in GI.Gdk.Objects.Event Methods toManagedPtr :: Event -> ManagedPtr Event # | |
| BoxedPtr Event Source # | |
Defined in GI.Gdk.Objects.Event | |
| TypedObject Event Source # | |
Defined in GI.Gdk.Objects.Event | |
| HasParentTypes Event Source # | |
Defined in GI.Gdk.Objects.Event | |
| type ParentTypes Event Source # | |
Defined in GI.Gdk.Objects.Event | |
class (BoxedPtr o, TypedObject o, IsDescendantOf Event o) => IsEvent o Source #
Instances
| (BoxedPtr o, TypedObject o, IsDescendantOf Event o) => IsEvent o Source # | |
Defined in GI.Gdk.Objects.Event | |
Methods
Overloaded methods
getAxes
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m (Bool, [Double]) | Returns: |
Extracts all axis values from an event.
getAxis
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> AxisUse |
|
| -> m (Bool, Double) | Returns: |
Extract the axis value for a particular axis use from an event structure.
getDevice
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m (Maybe Device) | Returns: a |
Returns the device of an event.
getDeviceTool
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m (Maybe DeviceTool) | Returns: The current device tool, or |
If the event was generated by a device that supports
different tools (eg. a tablet), this function will
return a DeviceTool representing the tool that
caused the event. Otherwise, Nothing will be returned.
Note: the GdkDeviceTools will be constant during
the application lifetime, if settings must be stored
persistently across runs, see deviceToolGetSerial
getDisplay
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m (Maybe Display) | Returns: a |
Retrieves the Display associated to the event.
getEventSequence
eventGetEventSequence Source #
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m EventSequence | Returns: the event sequence that the event belongs to |
If event is a touch event, returns the EventSequence
to which the event belongs. Otherwise, return Nothing.
getEventType
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m EventType | Returns: a |
Retrieves the type of the event.
getModifierState
eventGetModifierState Source #
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m [ModifierType] | Returns: the modifier state of |
Returns the modifier state field of an event.
getPointerEmulated
eventGetPointerEmulated Source #
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m Bool | Returns: |
Returns whether this event is an 'emulated' pointer event (typically from a touch event), as opposed to a real one.
getPosition
Extract the event surface relative x/y coordinates from an event.
getSourceDevice
This function returns the hardware (slave) Device that has
triggered the event, falling back to the virtual (master) device
(as in eventGetDevice) if the event wasn’t caused by
interaction with a hardware device. This may happen for example
in synthesized crossing events after a Surface updates its
geometry or a grab is acquired/released.
If the event does not contain a device field, this function will
return Nothing.
getSurface
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m Surface | Returns: The |
Extracts the Surface associated with an event.
getTime
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m Word32 | Returns: time stamp field from |
Returns the time stamp from event, if there is one; otherwise
returns CURRENT_TIME.
ref
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m Event | Returns: |
Increase the ref count of event.
triggersContextMenu
eventTriggersContextMenu Source #
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m Bool | Returns: |
This function returns whether a GdkEventButton should trigger a
context menu, according to platform conventions. The right mouse
button always triggers context menus.
This function should always be used instead of simply checking for
event->button == BUTTON_SECONDARY.
unref
Arguments
| :: (HasCallStack, MonadIO m, IsEvent a) | |
| => a |
|
| -> m () |
Decrease the ref count of event, and free it
if the last reference is dropped.