gi-gtk-4.0.1: 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.

getFocusOrigin

eventControllerKeyGetFocusOrigin Source #

Arguments

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

controller: a EventControllerKey

-> m Widget

Returns: the previous focus

Returns the widget that was holding focus before.

This function can only be used in handlers for the focusIn and focusOut signals.

getFocusTarget

eventControllerKeyGetFocusTarget Source #

Arguments

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

controller: a EventControllerKey

-> m Widget

Returns: the next focus

Returns the widget that will be holding focus afterwards.

This function can only be used in handlers for the focusIn and focusOut 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 eventGetKeyGroup.

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.

Properties

containsFocus

Whether focus is in a descendant of the controllers widget. See EventControllerKey:is-focus.

When handling focus events, this property is updated before focusIn or focusOut are emitted.

getEventControllerKeyContainsFocus :: (MonadIO m, IsEventControllerKey o) => o -> m Bool Source #

Get the value of the “contains-focus” property. When overloading is enabled, this is equivalent to

get eventControllerKey #containsFocus

isFocus

Whether focus is in the controllers widget itself, as opposed to in a descendent widget. See EventControllerKey:contains-focus.

When handling focus events, this property is updated before focusIn or focusOut are emitted.

getEventControllerKeyIsFocus :: (MonadIO m, IsEventControllerKey o) => o -> m Bool Source #

Get the value of the “is-focus” property. When overloading is enabled, this is equivalent to

get eventControllerKey #isFocus

Signals

focusIn

type C_EventControllerKeyFocusInCallback = Ptr () -> CUInt -> CUInt -> Ptr () -> IO () Source #

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

type EventControllerKeyFocusInCallback Source #

Arguments

 = CrossingMode

mode: crossing mode indicating what caused this change

-> NotifyType

detail: detail indication where the focus is coming from

-> IO () 

This signal is emitted whenever the widget controlled by the controller or one of its descendants) is given the keyboard focus.

afterEventControllerKeyFocusIn :: (IsEventControllerKey a, MonadIO m) => a -> EventControllerKeyFocusInCallback -> m SignalHandlerId Source #

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

after eventControllerKey #focusIn callback

onEventControllerKeyFocusIn :: (IsEventControllerKey a, MonadIO m) => a -> EventControllerKeyFocusInCallback -> m SignalHandlerId Source #

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

on eventControllerKey #focusIn callback

focusOut

type C_EventControllerKeyFocusOutCallback = Ptr () -> CUInt -> CUInt -> Ptr () -> IO () Source #

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

type EventControllerKeyFocusOutCallback Source #

Arguments

 = CrossingMode

mode: crossing mode indicating what caused this change

-> NotifyType

detail: detail indication where the focus is going

-> IO () 

This signal is emitted whenever the widget controlled by the controller (or one of its descendants) loses the keyboard focus.

afterEventControllerKeyFocusOut :: (IsEventControllerKey a, MonadIO m) => a -> EventControllerKeyFocusOutCallback -> m SignalHandlerId Source #

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

after eventControllerKey #focusOut callback

onEventControllerKeyFocusOut :: (IsEventControllerKey a, MonadIO m) => a -> EventControllerKeyFocusOutCallback -> m SignalHandlerId Source #

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

on eventControllerKey #focusOut callback

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