gi-gtk-4.0.2: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.EventControllerKey

Description

EventControllerKey is an event controller meant for situations where you need access to key events.

Synopsis

Exported types

class (GObject o, IsDescendantOf EventControllerKey o) => IsEventControllerKey o Source #

Type class for types which can be safely cast to EventControllerKey, for instance with toEventControllerKey.

Instances

Instances details
(GObject o, IsDescendantOf EventControllerKey o) => IsEventControllerKey o Source # 
Instance details

Defined in GI.Gtk.Objects.EventControllerKey

toEventControllerKey :: (MonadIO m, IsEventControllerKey o) => o -> m EventControllerKey Source #

Cast to EventControllerKey, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

forward

eventControllerKeyForward Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventControllerKey a, IsWidget b) 
=> a

controller: a EventControllerKey

-> b

widget: a Widget

-> m Bool

Returns: whether the widget handled the event

Forwards the current event of this controller to a widget.

This function can only be used in handlers for the keyPressed, keyReleased or modifiers signals.

getGroup

eventControllerKeyGetGroup Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventControllerKey a) 
=> a

controller: a EventControllerKey

-> m Word32

Returns: the key group

Gets the key group of the current event of this controller. See gdk_key_event_get_group().

getImContext

eventControllerKeyGetImContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventControllerKey a) 
=> a

controller: a EventControllerKey

-> m IMContext

Returns: the IMContext

Gets the input method context of the key controller.

new

eventControllerKeyNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m EventControllerKey

Returns: a new EventControllerKey

Creates a new event controller that will handle key events.

setImContext

eventControllerKeySetImContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsEventControllerKey a, IsIMContext b) 
=> a

controller: a EventControllerKey

-> b

imContext: a IMContext

-> m () 

Sets the input method context of the key controller.

Signals

imUpdate

type C_EventControllerKeyImUpdateCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type EventControllerKeyImUpdateCallback = IO () Source #

This signal is emitted whenever the input method context filters away a keypress and prevents the controller receiving it. See eventControllerKeySetImContext and iMContextFilterKeypress.

afterEventControllerKeyImUpdate :: (IsEventControllerKey a, MonadIO m) => a -> EventControllerKeyImUpdateCallback -> m SignalHandlerId Source #

Connect a signal handler for the imUpdate signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after eventControllerKey #imUpdate callback

onEventControllerKeyImUpdate :: (IsEventControllerKey a, MonadIO m) => a -> EventControllerKeyImUpdateCallback -> m SignalHandlerId Source #

Connect a signal handler for the imUpdate signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on eventControllerKey #imUpdate callback

keyPressed

type C_EventControllerKeyKeyPressedCallback = Ptr () -> Word32 -> Word32 -> CUInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type EventControllerKeyKeyPressedCallback Source #

Arguments

 = Word32

keyval: the pressed key.

-> Word32

keycode: the raw code of the pressed key.

-> [ModifierType]

state: the bitmask, representing the state of modifier keys and pointer buttons. See ModifierType.

-> IO Bool

Returns: True if the key press was handled, False otherwise.

This signal is emitted whenever a key is pressed.

afterEventControllerKeyKeyPressed :: (IsEventControllerKey a, MonadIO m) => a -> EventControllerKeyKeyPressedCallback -> m SignalHandlerId Source #

Connect a signal handler for the keyPressed signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after eventControllerKey #keyPressed callback

onEventControllerKeyKeyPressed :: (IsEventControllerKey a, MonadIO m) => a -> EventControllerKeyKeyPressedCallback -> m SignalHandlerId Source #

Connect a signal handler for the keyPressed signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on eventControllerKey #keyPressed callback

keyReleased

type C_EventControllerKeyKeyReleasedCallback = Ptr () -> Word32 -> Word32 -> CUInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type EventControllerKeyKeyReleasedCallback Source #

Arguments

 = Word32

keyval: the released key.

-> Word32

keycode: the raw code of the released key.

-> [ModifierType]

state: the bitmask, representing the state of modifier keys and pointer buttons. See ModifierType.

-> IO () 

This signal is emitted whenever a key is released.

afterEventControllerKeyKeyReleased :: (IsEventControllerKey a, MonadIO m) => a -> EventControllerKeyKeyReleasedCallback -> m SignalHandlerId Source #

Connect a signal handler for the keyReleased signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after eventControllerKey #keyReleased callback

onEventControllerKeyKeyReleased :: (IsEventControllerKey a, MonadIO m) => a -> EventControllerKeyKeyReleasedCallback -> m SignalHandlerId Source #

Connect a signal handler for the keyReleased signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on eventControllerKey #keyReleased callback

modifiers

type C_EventControllerKeyModifiersCallback = Ptr () -> CUInt -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type EventControllerKeyModifiersCallback Source #

Arguments

 = [ModifierType]

keyval: the released key.

-> IO Bool 

This signal is emitted whenever the state of modifier keys and pointer buttons change.

afterEventControllerKeyModifiers :: (IsEventControllerKey a, MonadIO m) => a -> EventControllerKeyModifiersCallback -> m SignalHandlerId Source #

Connect a signal handler for the modifiers signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after eventControllerKey #modifiers callback

onEventControllerKeyModifiers :: (IsEventControllerKey a, MonadIO m) => a -> EventControllerKeyModifiersCallback -> m SignalHandlerId Source #

Connect a signal handler for the modifiers signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on eventControllerKey #modifiers callback