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

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

WildBind.X11.Emulate

Contents

Description

This module defines functions to emulate key inputs.

See WildBind.X11.Emulate.Example for an example.

Since: 0.2.0.0

Synopsis

Create key inputs

sendKeyTo Source #

Arguments

:: (ToXKeyEvent k, MonadIO m) 
=> X11Front i 
-> Window

target window

-> k

Key event to send

-> m () 

Send a X11 key event to a Window.

sendKey :: (ToXKeyEvent k, MonadIO m, MonadReader Window m) => X11Front i -> k -> m () Source #

Same as sendKeyTo, but the target window is obtained from MonadReader.

pushTo :: (ToXKeyEvent k, MonadIO m) => X11Front i -> Window -> k -> m () Source #

Send a "key push" event to a Window, that is, send KeyPress and KeyRelease events.

push :: (ToXKeyEvent k, MonadIO m, MonadReader Window m) => X11Front i -> k -> m () Source #

Same as pushTo, but the target window is obtained from MonadReader.

Key remap binding

remap :: (ToXKeyEvent from, ToXKeyEvent to) => X11Front i -> from -> to -> Binding' bs ActiveWindow XKeyEvent Source #

Create a binding that remaps key event "from" to "to".

This binding captures KeyPress and KeyRelease events of "from", and sends respective events of "to" to the active window.

Sometimes remap doesn't work as you expect, because the KeyPress event is sent to the window while it doesn't have keyboard focus. In that case, try using remapR.

remapR :: (ToXKeyEvent from, ToXKeyEvent to) => X11Front i -> from -> to -> Binding' bs ActiveWindow XKeyEvent Source #

remap on Release. Like remap, but this binding captures only KeyRelease event and sends a pair of KeyPress and KeyRelease events.

Because the original KeyRelease event occurs after the focus returns to the window, the emulated events are sent to the window with focus.