Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
An event related to a key-based device.
Synopsis
- newtype KeyEvent = KeyEvent (ManagedPtr KeyEvent)
- class (BoxedPtr o, TypedObject o, IsDescendantOf KeyEvent o) => IsKeyEvent o
- toKeyEvent :: (MonadIO m, IsKeyEvent o) => o -> m KeyEvent
- keyEventGetConsumedModifiers :: (HasCallStack, MonadIO m, IsKeyEvent a) => a -> m [ModifierType]
- keyEventGetKeycode :: (HasCallStack, MonadIO m, IsKeyEvent a) => a -> m Word32
- keyEventGetKeyval :: (HasCallStack, MonadIO m, IsKeyEvent a) => a -> m Word32
- keyEventGetLayout :: (HasCallStack, MonadIO m, IsKeyEvent a) => a -> m Word32
- keyEventGetLevel :: (HasCallStack, MonadIO m, IsKeyEvent a) => a -> m Word32
- keyEventGetMatch :: (HasCallStack, MonadIO m, IsKeyEvent a) => a -> m (Bool, Word32, [ModifierType])
- keyEventIsModifier :: (HasCallStack, MonadIO m, IsKeyEvent a) => a -> m Bool
- keyEventMatches :: (HasCallStack, MonadIO m, IsKeyEvent a) => a -> Word32 -> [ModifierType] -> m KeyMatch
Exported types
Memory-managed wrapper type.
Instances
Eq KeyEvent Source # | |
BoxedPtr KeyEvent Source # | |
Defined in GI.Gdk.Objects.KeyEvent boxedPtrCopy :: KeyEvent -> IO KeyEvent boxedPtrFree :: KeyEvent -> IO () | |
ManagedPtrNewtype KeyEvent Source # | |
Defined in GI.Gdk.Objects.KeyEvent toManagedPtr :: KeyEvent -> ManagedPtr KeyEvent | |
TypedObject KeyEvent Source # | |
Defined in GI.Gdk.Objects.KeyEvent | |
HasParentTypes KeyEvent Source # | |
Defined in GI.Gdk.Objects.KeyEvent | |
type ParentTypes KeyEvent Source # | |
Defined in GI.Gdk.Objects.KeyEvent |
class (BoxedPtr o, TypedObject o, IsDescendantOf KeyEvent o) => IsKeyEvent o Source #
Type class for types which can be safely cast to KeyEvent
, for instance with toKeyEvent
.
Instances
(BoxedPtr o, TypedObject o, IsDescendantOf KeyEvent o) => IsKeyEvent o Source # | |
Defined in GI.Gdk.Objects.KeyEvent |
toKeyEvent :: (MonadIO m, IsKeyEvent o) => o -> m KeyEvent Source #
Methods
Click to display all available methods, including inherited ones
Methods
isModifier, matches, ref, triggersContextMenu, unref.
Getters
getAxes, getAxis, getConsumedModifiers, getDevice, getDeviceTool, getDisplay, getEventSequence, getEventType, getHistory, getKeycode, getKeyval, getLayout, getLevel, getMatch, getModifierState, getPointerEmulated, getPosition, getSeat, getSurface, getTime.
Setters
None.
getConsumedModifiers
keyEventGetConsumedModifiers Source #
:: (HasCallStack, MonadIO m, IsKeyEvent a) | |
=> a |
|
-> m [ModifierType] | Returns: the consumed modifiers or |
Extracts the consumed modifiers from a key event.
getKeycode
:: (HasCallStack, MonadIO m, IsKeyEvent a) | |
=> a |
|
-> m Word32 | Returns: the keycode of |
Extracts the keycode from a key event.
getKeyval
:: (HasCallStack, MonadIO m, IsKeyEvent a) | |
=> a |
|
-> m Word32 | Returns: the keyval of |
Extracts the keyval from a key event.
getLayout
:: (HasCallStack, MonadIO m, IsKeyEvent a) | |
=> a |
|
-> m Word32 | Returns: the layout of |
Extracts the layout from a key event.
getLevel
:: (HasCallStack, MonadIO m, IsKeyEvent a) | |
=> a |
|
-> m Word32 | Returns: the shift level of |
Extracts the shift level from a key event.
getMatch
:: (HasCallStack, MonadIO m, IsKeyEvent a) | |
=> a |
|
-> m (Bool, Word32, [ModifierType]) | Returns: |
Gets a keyval and modifier combination that will cause
keyEventMatches
to successfully match the given event.
isModifier
:: (HasCallStack, MonadIO m, IsKeyEvent a) | |
=> a |
|
-> m Bool | Returns: |
Extracts whether the key event is for a modifier key.
matches
:: (HasCallStack, MonadIO m, IsKeyEvent a) | |
=> a |
|
-> Word32 |
|
-> [ModifierType] |
|
-> m KeyMatch | Returns: a GdkKeyMatch value describing whether |
Matches a key event against a keyboard shortcut that is specified as a keyval and modifiers. Partial matches are possible where the combination matches if the currently active group is ignored.
Note that we ignore Caps Lock for matching.