wild-bind-indicator-0.1.0.1: Graphical indicator for WildBind

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

WildBind.Indicator

Contents

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 => (Indicator s i -> IO ()) -> IO () Source

Initialize the indicator and run the given action. This function should be used directly under main function.

main :: IO ()
main = withNumPadIndicator $ \indicator -> ...

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

Execution

wildBindWithIndicator :: (Ord i, Enum i, Bounded 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, Enum i, Bounded 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.

Generalization of number pad types

class NumPadPosition a where Source

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