miso-1.8.3.0: A tasty Haskell front-end framework

Copyright(C) 2016-2018 David M. Johnson
LicenseBSD3-style (see the file LICENSE)
MaintainerDavid M. Johnson <djohnson.m@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Miso.Subscription.Keyboard

Contents

Description

 
Synopsis

Types

data Arrows Source #

type for arrow keys currently pressed 37 left arrow ( x = -1 ) 38 up arrow ( y = 1 ) 39 right arrow ( x = 1 ) 40 down arrow ( y = -1 )

Constructors

Arrows 

Fields

Instances
Eq Arrows Source # 
Instance details

Defined in Miso.Subscription.Keyboard

Show Arrows Source # 
Instance details

Defined in Miso.Subscription.Keyboard

Subscriptions

arrowsSub :: (Arrows -> action) -> Sub action Source #

Maps Arrows onto a Keyboard subscription

directionSub :: ([Int], [Int], [Int], [Int]) -> (Arrows -> action) -> Sub action Source #

Maps a specified list of keys to directions (up, down, left, right)

keyboardSub :: (Set Int -> action) -> Sub action Source #

Returns subscription for Keyboard

wasdSub :: (Arrows -> action) -> Sub action Source #

Maps WASD onto a Keyboard subscription for directions