Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- addFilter
- copy
- free
- get
- getAngle
- getAxes
- getButton
- getClickCount
- getCoords
- getDevice
- getDeviceId
- getDeviceType
- getDistance
- getEventSequence
- getFlags
- getGestureMotionDelta
- getGesturePhase
- getGesturePinchAngleDelta
- getGesturePinchScale
- getGestureSwipeFingerCount
- getKeyCode
- getKeySymbol
- getKeyUnicode
- getPosition
- getRelated
- getScrollDelta
- getScrollDirection
- getSource
- getSourceDevice
- getStage
- getState
- getStateFull
- getTime
- hasControlModifier
- hasShiftModifier
- isPointerEmulated
- new
- peek
- put
- removeFilter
- setButton
- setCoords
- setDevice
- setFlags
- setKeyCode
- setKeySymbol
- setKeyUnicode
- setRelated
- setScrollDelta
- setScrollDirection
- setSource
- setSourceDevice
- setStage
- setState
- setTime
- type
Generic event wrapper.
Since: 0.2
Synopsis
- newtype Event = Event (ManagedPtr Event)
- newZeroEvent :: MonadIO m => m Event
- eventAddFilter :: (HasCallStack, MonadIO m, IsStage a) => Maybe a -> EventFilterFunc -> m Word32
- eventCopy :: (HasCallStack, MonadIO m) => Event -> m Event
- eventFree :: (HasCallStack, MonadIO m) => Event -> m ()
- eventGet :: (HasCallStack, MonadIO m) => m Event
- eventGetAngle :: (HasCallStack, MonadIO m) => Event -> Event -> m Double
- eventGetAxes :: (HasCallStack, MonadIO m) => Event -> m (Double, Word32)
- eventGetButton :: (HasCallStack, MonadIO m) => Event -> m Word32
- eventGetClickCount :: (HasCallStack, MonadIO m) => Event -> m Word32
- eventGetCoords :: (HasCallStack, MonadIO m) => Event -> m (Float, Float)
- eventGetDevice :: (HasCallStack, MonadIO m) => Event -> m InputDevice
- eventGetDeviceId :: (HasCallStack, MonadIO m) => Event -> m Int32
- eventGetDeviceType :: (HasCallStack, MonadIO m) => Event -> m InputDeviceType
- eventGetDistance :: (HasCallStack, MonadIO m) => Event -> Event -> m Float
- eventGetEventSequence :: (HasCallStack, MonadIO m) => Event -> m EventSequence
- eventGetFlags :: (HasCallStack, MonadIO m) => Event -> m [EventFlags]
- eventGetGestureMotionDelta :: (HasCallStack, MonadIO m) => Event -> m (Double, Double)
- eventGetGesturePhase :: (HasCallStack, MonadIO m) => Event -> m TouchpadGesturePhase
- eventGetGesturePinchAngleDelta :: (HasCallStack, MonadIO m) => Event -> m Double
- eventGetGesturePinchScale :: (HasCallStack, MonadIO m) => Event -> m Double
- eventGetGestureSwipeFingerCount :: (HasCallStack, MonadIO m) => Event -> m Word32
- eventGetKeyCode :: (HasCallStack, MonadIO m) => Event -> m Word16
- eventGetKeySymbol :: (HasCallStack, MonadIO m) => Event -> m Word32
- eventGetKeyUnicode :: (HasCallStack, MonadIO m) => Event -> m Char
- eventGetPosition :: (HasCallStack, MonadIO m) => Event -> Point -> m ()
- eventGetRelated :: (HasCallStack, MonadIO m) => Event -> m Actor
- eventGetScrollDelta :: (HasCallStack, MonadIO m) => Event -> m (Double, Double)
- eventGetScrollDirection :: (HasCallStack, MonadIO m) => Event -> m ScrollDirection
- eventGetSource :: (HasCallStack, MonadIO m) => Event -> m Actor
- eventGetSourceDevice :: (HasCallStack, MonadIO m) => Event -> m InputDevice
- eventGetStage :: (HasCallStack, MonadIO m) => Event -> m Stage
- eventGetState :: (HasCallStack, MonadIO m) => Event -> m [ModifierType]
- eventGetStateFull :: (HasCallStack, MonadIO m) => Event -> m ([ModifierType], [ModifierType], [ModifierType], [ModifierType], [ModifierType])
- eventGetTime :: (HasCallStack, MonadIO m) => Event -> m Word32
- eventHasControlModifier :: (HasCallStack, MonadIO m) => Event -> m Bool
- eventHasShiftModifier :: (HasCallStack, MonadIO m) => Event -> m Bool
- eventIsPointerEmulated :: (HasCallStack, MonadIO m) => Event -> m Bool
- eventNew :: (HasCallStack, MonadIO m) => EventType -> m Event
- eventPeek :: (HasCallStack, MonadIO m) => m Event
- eventPut :: (HasCallStack, MonadIO m) => Event -> m ()
- eventRemoveFilter :: (HasCallStack, MonadIO m) => Word32 -> m ()
- eventSetButton :: (HasCallStack, MonadIO m) => Event -> Word32 -> m ()
- eventSetCoords :: (HasCallStack, MonadIO m) => Event -> Float -> Float -> m ()
- eventSetDevice :: (HasCallStack, MonadIO m, IsInputDevice a) => Event -> Maybe a -> m ()
- eventSetFlags :: (HasCallStack, MonadIO m) => Event -> [EventFlags] -> m ()
- eventSetKeyCode :: (HasCallStack, MonadIO m) => Event -> Word16 -> m ()
- eventSetKeySymbol :: (HasCallStack, MonadIO m) => Event -> Word32 -> m ()
- eventSetKeyUnicode :: (HasCallStack, MonadIO m) => Event -> Char -> m ()
- eventSetRelated :: (HasCallStack, MonadIO m, IsActor a) => Event -> Maybe a -> m ()
- eventSetScrollDelta :: (HasCallStack, MonadIO m) => Event -> Double -> Double -> m ()
- eventSetScrollDirection :: (HasCallStack, MonadIO m) => Event -> ScrollDirection -> m ()
- eventSetSource :: (HasCallStack, MonadIO m, IsActor a) => Event -> Maybe a -> m ()
- eventSetSourceDevice :: (HasCallStack, MonadIO m, IsInputDevice a) => Event -> Maybe a -> m ()
- eventSetStage :: (HasCallStack, MonadIO m, IsStage a) => Event -> Maybe a -> m ()
- eventSetState :: (HasCallStack, MonadIO m) => Event -> [ModifierType] -> m ()
- eventSetTime :: (HasCallStack, MonadIO m) => Event -> Word32 -> m ()
- eventType :: (HasCallStack, MonadIO m) => Event -> m EventType
Exported types
Memory-managed wrapper type.
Instances
Eq Event Source # | |
GBoxed Event Source # | |
Defined in GI.Clutter.Unions.Event | |
ManagedPtrNewtype Event Source # | |
Defined in GI.Clutter.Unions.Event toManagedPtr :: Event -> ManagedPtr Event | |
TypedObject Event Source # | |
Defined in GI.Clutter.Unions.Event | |
HasParentTypes Event Source # | |
Defined in GI.Clutter.Unions.Event | |
tag ~ 'AttrSet => Constructible Event tag Source # | |
IsGValue (Maybe Event) Source # | Convert |
Defined in GI.Clutter.Unions.Event gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Event -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Event) | |
type ParentTypes Event Source # | |
Defined in GI.Clutter.Unions.Event |
Methods
Click to display all available methods, including inherited ones
Methods
copy, free, hasControlModifier, hasShiftModifier, isPointerEmulated, put, type.
Getters
getAngle, getAxes, getButton, getClickCount, getCoords, getDevice, getDeviceId, getDeviceType, getDistance, getEventSequence, getFlags, getGestureMotionDelta, getGesturePhase, getGesturePinchAngleDelta, getGesturePinchScale, getGestureSwipeFingerCount, getKeyCode, getKeySymbol, getKeyUnicode, getPosition, getRelated, getScrollDelta, getScrollDirection, getSource, getSourceDevice, getStage, getState, getStateFull, getTime.
Setters
setButton, setCoords, setDevice, setFlags, setKeyCode, setKeySymbol, setKeyUnicode, setRelated, setScrollDelta, setScrollDirection, setSource, setSourceDevice, setStage, setState, setTime.
addFilter
:: (HasCallStack, MonadIO m, IsStage a) | |
=> Maybe a |
|
-> EventFilterFunc |
|
-> m Word32 | Returns: an identifier for the event filter, to be used
with |
Adds a function which will be called for all events that Clutter processes. The function will be called before any signals are emitted for the event and it will take precedence over any grabs.
Since: 1.18
copy
Copies event
.
free
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m () |
Frees all resources used by event
.
get
:: (HasCallStack, MonadIO m) | |
=> m Event | Returns: A |
Pops an event off the event queue. Applications should not need to call this.
Since: 0.4
getAngle
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Event |
|
-> m Double | Returns: the angle between two |
Retrieves the angle relative from source
to target
.
The direction of the angle is from the position X axis towards the positive Y axis.
Since: 1.12
getAxes
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Double, Word32) | Returns: an array of axis values |
Retrieves the array of axes values attached to the event.
Since: 1.6
getButton
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Word32 | Returns: the button number |
Retrieves the button number of event
Since: 1.0
getClickCount
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Word32 | Returns: the click count |
Retrieves the number of clicks of event
Since: 1.0
getCoords
Retrieves the coordinates of event
and puts them into x
and y
.
Since: 0.4
getDevice
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m InputDevice | Returns: the |
Retrieves the InputDevice
for the event.
If you want the physical device the event originated from, use
eventGetSourceDevice
.
The InputDevice
structure is completely opaque and should
be cast to the platform-specific implementation.
Since: 1.0
getDeviceId
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Int32 | Returns: A unique identifier for the device or -1 if the event has no specific device set. |
Retrieves the events device id if set.
getDeviceType
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m InputDeviceType | Returns: the |
Retrieves the type of the device for event
Since: 1.0
getDistance
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Event |
|
-> m Float | Returns: the distance between two |
Retrieves the distance between two events, a source
and a target
.
Since: 1.12
getEventSequence
eventGetEventSequence Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m EventSequence | Returns: the event sequence, or |
Retrieves the EventSequence
of event
.
Since: 1.10
getFlags
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m [EventFlags] | Returns: the event flags |
Retrieves the EventFlags
of event
Since: 1.0
getGestureMotionDelta
eventGetGestureMotionDelta Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Double, Double) |
Returns the gesture motion deltas relative to the current pointer position.
Since: 1.24
getGesturePhase
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m TouchpadGesturePhase | Returns: the phase of the gesture event. |
Returns the phase of the event, See TouchpadGesturePhase
.
getGesturePinchAngleDelta
eventGetGesturePinchAngleDelta Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Double | Returns: The angle delta relative to the previous event. |
Returns the angle delta reported by this specific event.
Since: 1.24
getGesturePinchScale
eventGetGesturePinchScale Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Double | Returns: the current pinch gesture scale |
Returns the current scale as reported by event
, 1.0 being the original
distance at the time the corresponding event with phase
TouchpadGesturePhaseBegin
is received.
is received.
Since: 1.24
getGestureSwipeFingerCount
eventGetGestureSwipeFingerCount Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Word32 | Returns: the number of fingers swiping. |
Returns the number of fingers that is triggering the touchpad gesture.
Since: 1.24
getKeyCode
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Word16 | Returns: The keycode representing the key |
Retrieves the keycode of the key that caused event
Since: 1.0
getKeySymbol
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Word32 | Returns: the key symbol representing the key |
Retrieves the key symbol of event
Since: 1.0
getKeyUnicode
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Char | Returns: The unicode value representing the key |
Retrieves the unicode value for the key that caused keyev
.
getPosition
Retrieves the event coordinates as a Point
.
Since: 1.12
getRelated
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Actor |
Retrieves the related actor of a crossing event.
Since: 1.0
getScrollDelta
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m (Double, Double) |
Retrieves the precise scrolling information of event
.
The event
has to have a ScrollEvent
.direction
value
of ScrollDirectionSmooth
.
Since: 1.10
getScrollDirection
eventGetScrollDirection Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m ScrollDirection | Returns: the scrolling direction |
Retrieves the direction of the scrolling of event
Since: 1.0
getSource
Retrieves the source Actor
the event originated from, or
NULL if the event has no source.
Since: 0.6
getSourceDevice
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m InputDevice | Returns: a pointer to a |
Retrieves the hardware device that originated the event.
If you need the virtual device, use eventGetDevice
.
If no hardware device originated this event, this function will
return the same device as eventGetDevice
.
Since: 1.6
getStage
getState
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m [ModifierType] | Returns: the modifier state parameter, or 0 |
Retrieves the modifier state of the event. In case the window system supports reporting latched and locked modifiers, this function returns the effective state.
Since: 0.4
getStateFull
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m ([ModifierType], [ModifierType], [ModifierType], [ModifierType], [ModifierType]) |
Retrieves the decomposition of the keyboard state into button, base, latched, locked and effective. This can be used to transmit to other applications, for example when implementing a wayland compositor.
Since: 1.16
getTime
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Word32 | Returns: the time of the event, or |
Retrieves the time of the event.
Since: 0.4
hasControlModifier
eventHasControlModifier Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Bool | Returns: |
Checks whether event
has the Control modifier mask set.
Since: 1.12
hasShiftModifier
eventHasShiftModifier Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Bool | Returns: |
Checks whether event
has the Shift modifier mask set.
Since: 1.12
isPointerEmulated
eventIsPointerEmulated Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m Bool | Returns: |
Checks whether a pointer event
has been generated by the windowing
system. The returned value can be used to distinguish between events
synthesized by the windowing system itself (as opposed by Clutter).
Since: 1.12
new
:: (HasCallStack, MonadIO m) | |
=> EventType |
|
-> m Event | Returns: A newly allocated |
Creates a new Event
of the specified type.
peek
:: (HasCallStack, MonadIO m) | |
=> m Event | Returns: A |
Returns a pointer to the first event from the event queue but does not remove it.
Since: 0.4
put
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> m () |
Puts a copy of the event on the back of the event queue. The event will
have the EventFlagsFlagSynthetic
flag set. If the source is set
event signals will be emitted for this source and capture/bubbling for
its ancestors. If the source is not set it will be generated by picking
or use the actor that currently has keyboard focus
Since: 0.6
removeFilter
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m () |
Removes an event filter that was previously added with
eventAddFilter
.
Since: 1.18
setButton
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Word32 |
|
-> m () |
Sets the button number of event
Since: 1.8
setCoords
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Float |
|
-> Float |
|
-> m () |
Sets the coordinates of the event
.
Since: 1.8
setDevice
:: (HasCallStack, MonadIO m, IsInputDevice a) | |
=> Event |
|
-> Maybe a |
|
-> m () |
Sets the device for event
.
Since: 1.6
setFlags
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> [EventFlags] |
|
-> m () |
Sets the EventFlags
of event
Since: 1.8
setKeyCode
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Word16 |
|
-> m () |
Sets the keycode of the event
.
Since: 1.8
setKeySymbol
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Word32 |
|
-> m () |
Sets the key symbol of event
.
Since: 1.8
setKeyUnicode
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Char |
|
-> m () |
Sets the Unicode value of event
.
Since: 1.8
setRelated
:: (HasCallStack, MonadIO m, IsActor a) | |
=> Event |
|
-> Maybe a | |
-> m () |
Sets the related actor of a crossing event
Since: 1.8
setScrollDelta
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Double |
|
-> Double |
|
-> m () |
Sets the precise scrolling information of event
.
Since: 1.10
setScrollDirection
eventSetScrollDirection Source #
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> ScrollDirection |
|
-> m () |
Sets the direction of the scrolling of event
Since: 1.8
setSource
Sets the source Actor
of event
.
Since: 1.8
setSourceDevice
:: (HasCallStack, MonadIO m, IsInputDevice a) | |
=> Event |
|
-> Maybe a |
|
-> m () |
setStage
Sets the source Stage
of the event.
Since: 1.8
setState
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> [ModifierType] |
|
-> m () |
Sets the modifier state of the event.
Since: 1.8
setTime
:: (HasCallStack, MonadIO m) | |
=> Event |
|
-> Word32 |
|
-> m () |
Sets the time of the event.
Since: 1.8