wild-bind-x11-0.2.0.4: X11-specific implementation for WildBind

MaintainerToshio Ito <debug.ito@gmail.com>
Safe HaskellNone
LanguageHaskell2010

WildBind.X11.Internal.Key

Contents

Description

This is an internal module. Package users should not rely on this.

Synopsis

Key

class XKeyInput k where Source #

Class of data types that can be handled by X11. The data type can tell X11 to grab key with optional modifiers, and it can be extracted from a X11 Event object.

Since: 0.2.0.0

Minimal complete definition

toKeySym, fromKeyEvent

Methods

toKeySym :: k -> KeySym Source #

Get the X11 keysym for this input.

toModifierMasks :: KeyMaskMap -> k -> NonEmpty KeyMask Source #

Get modifer masks to grab the keysym. The grab action is repeated for all modifier masks. By default, it just returns 0.

fromKeyEvent :: KeyMaskMap -> KeyEventType -> KeySym -> KeyMask -> Maybe k Source #

Create the input object from a key event type, a keysym and a modifier (got from XEvent.)

Instances

XKeyInput NumPadUnlocked Source #

This input event captures the KeyRelease event only. That way, you can deliver events to the window that originally has the keyboard focus.

XKeyInput NumPadLocked Source #

This input event captures the KeyRelease event only. That way, you can deliver events to the window that originally has the keyboard focus.

XKeyInput XKeyEvent Source #

fromKeyEvent always returns Just.

(XKeyInput a, XKeyInput b) => XKeyInput (Either a b) Source #

fromKeyEvent first tries to create Left (type a). If it fails, then it tries to create Right (type b).

xKeyEventToXKeyInput :: XKeyInput k => KeyMaskMap -> KeyEventType -> XKeyEventPtr -> MaybeT IO k Source #

Extract the XKeyInput from the XKeyEvent.

Since: 0.2.0.0

Modifiers

getKeyMaskMap :: Display -> IO KeyMaskMap Source #

Get current KeyMaskMap.

Since: 0.2.0.0

XKeyEvent

data XMod Source #

X11 key modifiers.

Since: 0.2.0.0

Constructors

Shift 
Ctrl 
Alt 
Super 

Instances

Bounded XMod Source # 
Enum XMod Source # 

Methods

succ :: XMod -> XMod #

pred :: XMod -> XMod #

toEnum :: Int -> XMod #

fromEnum :: XMod -> Int #

enumFrom :: XMod -> [XMod] #

enumFromThen :: XMod -> XMod -> [XMod] #

enumFromTo :: XMod -> XMod -> [XMod] #

enumFromThenTo :: XMod -> XMod -> XMod -> [XMod] #

Eq XMod Source # 

Methods

(==) :: XMod -> XMod -> Bool #

(/=) :: XMod -> XMod -> Bool #

Ord XMod Source # 

Methods

compare :: XMod -> XMod -> Ordering #

(<) :: XMod -> XMod -> Bool #

(<=) :: XMod -> XMod -> Bool #

(>) :: XMod -> XMod -> Bool #

(>=) :: XMod -> XMod -> Bool #

max :: XMod -> XMod -> XMod #

min :: XMod -> XMod -> XMod #

Show XMod Source # 

Methods

showsPrec :: Int -> XMod -> ShowS #

show :: XMod -> String #

showList :: [XMod] -> ShowS #

class ToXKeyEvent k where Source #

Something that can converted to XKeyEvent.

Since: 0.2.0.0

Minimal complete definition

toXKeyEvent

Methods

toXKeyEvent :: k -> XKeyEvent Source #

addXMod :: ToXKeyEvent k => XMod -> k -> XKeyEvent Source #

Add a XMod to xKeyEventMods.

Since: 0.2.0.0

press :: ToXKeyEvent k => k -> XKeyEvent Source #

Set KeyPress to xKeyEventType.

Since: 0.2.0.0

release :: ToXKeyEvent k => k -> XKeyEvent Source #

Set KeyRelease to xKeyEventType.

Since: 0.2.0.0

shift :: ToXKeyEvent k => k -> XKeyEvent Source #

Add Shift modifier to xKeyEventMods.

Since: 0.2.0.0

ctrl :: ToXKeyEvent k => k -> XKeyEvent Source #

Add Ctrl modifier to xKeyEventMods.

Since: 0.2.0.0

alt :: ToXKeyEvent k => k -> XKeyEvent Source #

Add Alt modifier to xKeyEventMods.

Since: 0.2.0.0

super :: ToXKeyEvent k => k -> XKeyEvent Source #

Add Super modifier to xKeyEventMods.

Since: 0.2.0.0

Grabs

xGrabKey :: Display -> Window -> KeySym -> KeyMask -> IO () Source #

Grab the specified key on the specified window. The key is captured from now on, so the window won't get that.

Since: 0.2.0.0

xUngrabKey :: Display -> Window -> KeySym -> KeyMask -> IO () Source #

Release the grab on the specified key.

Since: 0.2.0.0

Event generation

xSendKeyEvent :: KeyMaskMap -> Display -> Window -> XKeyEvent -> IO () Source #

Send a XKeyEvent to the window.

Since: 0.2.0.0