wild-bind-indicator-1.0.0.1: Graphical indicator for WildBind
MaintainerToshio Ito <debug.ito@gmail.com>
Safe HaskellNone
LanguageHaskell2010

WildBind.Indicator

Description

This module exports the Indicator, a graphical interface that explains the current bindings to the user. The Indicator uses optBindingHook in Option to receive the current bindings from wild-bind.

Synopsis

Construction

withNumPadIndicator :: (NumPadPosition i, Enum i, Bounded i) => (Indicator s i -> IO ()) -> IO () Source #

Initialize the indicator and run the given action.

The executable must be compiled by ghc with -threaded option enabled. Otherwise, it aborts.

Execution

wildBindWithIndicator :: Ord i => Indicator s i -> Binding s i -> FrontEnd s i -> IO () Source #

Run wildBind with the given Indicator. ActionDescriptions are shown by the Indicator.

Low-level function

bindingHook :: Ord i => Indicator s1 i -> FrontEnd s2 i -> [(i, ActionDescription)] -> IO () Source #

Create an action appropriate for optBindingHook in Option from Indicator and FrontEnd.

Indicator type and its actions

data Indicator s i Source #

Indicator interface. s is the front-end state, i is the input type.

updateDescription :: Indicator s i -> i -> ActionDescription -> IO () Source #

Update and show the description for the current binding.

getPresence :: Indicator s i -> IO Bool Source #

Get the current presence of the indicator. Returns True if it's present.

setPresence :: Indicator s i -> Bool -> IO () Source #

Set the presence of the indicator.

togglePresence :: Indicator s i -> IO () Source #

Toggle the presence of the indicator.

quit :: Indicator s i -> IO () Source #

Destroy the indicator. This usually means quitting the entire application.

Conversion

adaptIndicator Source #

Arguments

:: (i -> i')

mapper function

-> (i' -> Maybe i)

contra-mapper function

-> Indicator s i

original

-> Indicator s i'

adapted indicator

Map input type of Indicator, so that it can adapt to the new input type i'.

If the contra-mapper function returns Nothing, those input symbols are ignored by the Indicator.

Since: 0.2.0.0

Binding

toggleBinding Source #

Arguments

:: (NumPadPosition i, Ord i, Enum i, Bounded i) 
=> Indicator s i 
-> NumPadLocked

the button to bind the togglePresence action

-> Binding' bs fs i 

A binding that toggles presence of the Indicator.

Since: 0.2.0.0

Generalization of number pad types

class NumPadPosition a where Source #

Something that can be mapped to number pad's key positions.

Methods

toNumPad :: a -> NumPadLocked Source #

Instances

Instances details
NumPadPosition NumPadLocked Source # 
Instance details

Defined in WildBind.Indicator

Methods

toNumPad :: NumPadLocked -> NumPadLocked Source #

NumPadPosition NumPadUnlocked Source # 
Instance details

Defined in WildBind.Indicator

Methods

toNumPad :: NumPadUnlocked -> NumPadLocked Source #