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 |
- Exported types
- Methods
- Overloaded methods
- copy
- getAxes
- getAxis
- getButton
- getClickCount
- getCoords
- getCrossingDetail
- getCrossingMode
- getDevice
- getDeviceTool
- getDisplay
- getDrop
- getEventSequence
- getEventType
- getFocusIn
- getGrabSurface
- getKeyGroup
- getKeyIsModifier
- getKeycode
- getKeyval
- getMotionHistory
- getPadAxisValue
- getPadButton
- getPadGroupMode
- getPointerEmulated
- getRootCoords
- getScancode
- getScrollDeltas
- getScrollDirection
- getSeat
- getSourceDevice
- getState
- getSurface
- getTime
- getTouchEmulatingPointer
- getTouchpadAngleDelta
- getTouchpadDeltas
- getTouchpadGestureNFingers
- getTouchpadGesturePhase
- getTouchpadScale
- isScrollStopEvent
- isSent
- new
- setCoords
- setDevice
- setDeviceTool
- setDisplay
- setKeyval
- setSourceDevice
- triggersContextMenu
- Properties
The GdkEvent struct contains only private fields and should not be accessed directly.
Synopsis
- newtype Event = Event (ManagedPtr Event)
- class (GObject o, IsDescendantOf Event o) => IsEvent o
- toEvent :: (MonadIO m, IsEvent o) => o -> m Event
- noEvent :: Maybe Event
- eventCopy :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Event
- eventGetAxes :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, [Double])
- eventGetAxis :: (HasCallStack, MonadIO m, IsEvent a) => a -> AxisUse -> m (Bool, Double)
- eventGetButton :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Word32)
- eventGetClickCount :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Word32)
- eventGetCoords :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Double, Double)
- eventGetCrossingDetail :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, NotifyType)
- eventGetCrossingMode :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, CrossingMode)
- eventGetDevice :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Maybe Device)
- eventGetDeviceTool :: (HasCallStack, MonadIO m, IsEvent a) => a -> m DeviceTool
- eventGetDisplay :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Maybe Display)
- eventGetDrop :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Maybe Drop)
- eventGetEventSequence :: (HasCallStack, MonadIO m, IsEvent a) => a -> m EventSequence
- eventGetEventType :: (HasCallStack, MonadIO m, IsEvent a) => a -> m EventType
- eventGetFocusIn :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Bool)
- eventGetGrabSurface :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Surface)
- eventGetKeyGroup :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Word32)
- eventGetKeyIsModifier :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Bool)
- eventGetKeycode :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Word16)
- eventGetKeyval :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Word32)
- eventGetMotionHistory :: (HasCallStack, MonadIO m, IsEvent a) => a -> m [TimeCoord]
- eventGetPadAxisValue :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Word32, Double)
- eventGetPadButton :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Word32)
- eventGetPadGroupMode :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Word32, Word32)
- eventGetPointerEmulated :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Bool
- eventGetRootCoords :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Double, Double)
- eventGetScancode :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Int32
- eventGetScrollDeltas :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Double, Double)
- eventGetScrollDirection :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, ScrollDirection)
- eventGetSeat :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Seat
- eventGetSourceDevice :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Maybe Device)
- eventGetState :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, [ModifierType])
- eventGetSurface :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Surface
- eventGetTime :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Word32
- eventGetTouchEmulatingPointer :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Bool)
- eventGetTouchpadAngleDelta :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Double)
- eventGetTouchpadDeltas :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Double, Double)
- eventGetTouchpadGestureNFingers :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Word32)
- eventGetTouchpadGesturePhase :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, TouchpadGesturePhase)
- eventGetTouchpadScale :: (HasCallStack, MonadIO m, IsEvent a) => a -> m (Bool, Double)
- eventIsScrollStopEvent :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Bool
- eventIsSent :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Bool
- eventNew :: (HasCallStack, MonadIO m) => EventType -> m Event
- eventSetCoords :: (HasCallStack, MonadIO m, IsEvent a) => a -> Double -> Double -> m ()
- eventSetDevice :: (HasCallStack, MonadIO m, IsEvent a, IsDevice b) => a -> b -> m ()
- eventSetDeviceTool :: (HasCallStack, MonadIO m, IsEvent a, IsDeviceTool b) => a -> Maybe b -> m ()
- eventSetDisplay :: (HasCallStack, MonadIO m, IsEvent a, IsDisplay b) => a -> b -> m ()
- eventSetKeyval :: (HasCallStack, MonadIO m, IsEvent a) => a -> Word32 -> m ()
- eventSetSourceDevice :: (HasCallStack, MonadIO m, IsEvent a, IsDevice b) => a -> b -> m ()
- eventTriggersContextMenu :: (HasCallStack, MonadIO m, IsEvent a) => a -> m Bool
- constructEventEventType :: IsEvent o => EventType -> IO (GValueConstruct o)
- getEventEventType :: (MonadIO m, IsEvent o) => o -> m EventType
Exported types
Memory-managed wrapper type.
Instances
Eq Event Source # | |
GObject Event Source # | |
Defined in GI.Gdk.Objects.Event gobjectType :: IO GType # | |
IsGValue Event Source # | Convert |
HasParentTypes Event Source # | |
Defined in GI.Gdk.Objects.Event | |
type ParentTypes Event Source # | |
Defined in GI.Gdk.Objects.Event |
class (GObject o, IsDescendantOf Event o) => IsEvent o Source #
Instances
(GObject o, IsDescendantOf Event o) => IsEvent o Source # | |
Defined in GI.Gdk.Objects.Event |
Methods
Overloaded methods
copy
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m Event | Returns: a copy of |
Copies a GdkEvent
, copying or incrementing the reference count of the
resources associated with it (e.g. Surface
’s and strings).
getAxes
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, [Double]) |
Extracts all axis values from an event.
getAxis
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> AxisUse |
|
-> m (Bool, Double) | Returns: |
Extract the axis value for a particular axis use from an event structure.
getButton
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Word32) | Returns: |
Extract the button number from an event.
getClickCount
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Word32) | Returns: |
Extracts the click count from an event.
getCoords
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Double, Double) | Returns: |
Extract the event surface relative x/y coordinates from an event.
getCrossingDetail
eventGetCrossingDetail Source #
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, NotifyType) |
Extracts the crossing detail from an event.
getCrossingMode
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, CrossingMode) |
Extracts the crossing mode from an event.
getDevice
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Maybe Device) |
If the event contains a “device” field, this function will return
it, else it will return Nothing
.
getDeviceTool
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m 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 DeviceTool
s will be constant during
the application lifetime, if settings must be stored
persistently across runs, see deviceToolGetSerial
getDisplay
Retrieves the Display
associated to the event
.
getDrop
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Maybe Drop) | Returns: the drop |
Gets the Drop
from a DND event.
getEventSequence
eventGetEventSequence Source #
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m EventSequence | Returns: the event sequence that the event belongs to |
If event
if of type EventTypeTouchBegin
, EventTypeTouchUpdate
,
EventTypeTouchEnd
or EventTypeTouchCancel
, returns the EventSequence
to which the event belongs. Otherwise, return Nothing
.
getEventType
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m EventType | Returns: a |
Retrieves the type of the event.
getFocusIn
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Bool) |
Extracts whether this is a focus-in or focus-out event.
getGrabSurface
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Surface) |
Extracts the grab surface from a grab broken event.
getKeyGroup
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Word32) |
Extracts the key group from an event.
getKeyIsModifier
eventGetKeyIsModifier Source #
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Bool) |
Extracts whether the event is a key event for a modifier key.
getKeycode
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Word16) | Returns: |
Extracts the hardware keycode from an event.
Also see eventGetScancode
.
getKeyval
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Word32) | Returns: |
Extracts the keyval from an event.
getMotionHistory
eventGetMotionHistory Source #
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m [TimeCoord] | Returns: a list of time and coordinates |
Retrieves the history of the event
motion, as a list of time and
coordinates.
getPadAxisValue
Extracts the information from a pad event.
getPadButton
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Word32) |
Extracts information about the pressed button from a pad event.
getPadGroupMode
Extracts group and mode information from a pad event.
getPointerEmulated
eventGetPointerEmulated Source #
:: (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.
getRootCoords
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Double, Double) | Returns: |
Extract the root window relative x/y coordinates from an event.
getScancode
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m Int32 | Returns: The associated keyboard scancode or 0 |
Gets the keyboard low-level scancode of a key event.
This is usually hardware_keycode. On Windows this is the high word of WM_KEY{DOWN,UP} lParam which contains the scancode and some extended flags.
getScrollDeltas
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Double, Double) | Returns: |
Retrieves the scroll deltas from a GdkEvent
getScrollDirection
eventGetScrollDirection Source #
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, ScrollDirection) | Returns: |
Extracts the scroll direction from an event.
getSeat
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m Seat | Returns: The |
Returns the Seat
this event was generated for.
getSourceDevice
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Maybe Device) |
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
.
getState
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, [ModifierType]) | Returns: |
If the event contains a “state” field, puts that field in state
.
Otherwise stores an empty state (0).
event
may be Nothing
, in which case it’s treated
as if the event had no state field.
getSurface
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m Surface | Returns: The |
Extracts the Surface
associated with an event.
getTime
:: (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
. If event
is Nothing
, returns CURRENT_TIME
.
getTouchEmulatingPointer
eventGetTouchEmulatingPointer Source #
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Bool) |
Extracts whether a touch event is emulating a pointer event.
getTouchpadAngleDelta
eventGetTouchpadAngleDelta Source #
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Double) |
Extracts the angle from a touchpad event.
getTouchpadDeltas
eventGetTouchpadDeltas Source #
Extracts delta information from a touchpad event.
getTouchpadGestureNFingers
eventGetTouchpadGestureNFingers Source #
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Word32) |
Extracts the number of fingers from a touchpad event.
getTouchpadGesturePhase
eventGetTouchpadGesturePhase Source #
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, TouchpadGesturePhase) |
Extracts the touchpad gesture phase from a touchpad event.
getTouchpadScale
eventGetTouchpadScale Source #
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m (Bool, Double) |
Extracts the scale from a touchpad event.
isScrollStopEvent
eventIsScrollStopEvent Source #
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m Bool | Returns: |
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 a delta of 0/0.
isSent
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the event was sent explicitly.
new
:: (HasCallStack, MonadIO m) | |
=> EventType |
|
-> m Event | Returns: a newly-allocated |
Creates a new event of the given type. All fields are set to 0.
setCoords
eventSetCoords :: (HasCallStack, MonadIO m, IsEvent a) => a -> Double -> Double -> m () Source #
No description available in the introspection data.
setDevice
:: (HasCallStack, MonadIO m, IsEvent a, IsDevice b) | |
=> a |
|
-> b |
|
-> m () |
Sets the device for event
to device
. The event must
have been allocated by GTK+, for instance, by
eventCopy
.
setDeviceTool
:: (HasCallStack, MonadIO m, IsEvent a, IsDeviceTool b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Sets the device tool for this event, should be rarely used.
setDisplay
:: (HasCallStack, MonadIO m, IsEvent a, IsDisplay b) | |
=> a |
|
-> b |
|
-> m () |
Sets the display that an event is associated with.
setKeyval
eventSetKeyval :: (HasCallStack, MonadIO m, IsEvent a) => a -> Word32 -> m () Source #
No description available in the introspection data.
setSourceDevice
:: (HasCallStack, MonadIO m, IsEvent a, IsDevice b) | |
=> a |
|
-> b |
|
-> m () |
Sets the slave device for event
to device
.
The event must have been allocated by GTK+,
for instance by eventCopy
.
triggersContextMenu
eventTriggersContextMenu Source #
:: (HasCallStack, MonadIO m, IsEvent a) | |
=> a |
|
-> m Bool | Returns: |
This function returns whether a EventButton
should trigger a
context menu, according to platform conventions. The right mouse
button always triggers context menus. Additionally, if
keymapGetModifierMask
returns a non-0 mask for
ModifierIntentContextMenu
, then the left mouse button will
also trigger a context menu if this modifier is pressed.
This function should always be used instead of simply checking for
event->button == BUTTON_SECONDARY
.
Properties
eventType
No description available in the introspection data.
constructEventEventType :: IsEvent o => EventType -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “event-type
” property. This is rarely needed directly, but it is used by new
.
getEventEventType :: (MonadIO m, IsEvent o) => o -> m EventType Source #
Get the value of the “event-type
” property.
When overloading is enabled, this is equivalent to
get
event #eventType