Module

FRP.Event.Keyboard

Package
purescript-hyrule
Repository
mikesol/purescript-hyrule

#Keyboard Source

newtype Keyboard

A handle for creating events from the keyboard.

#getKeyboard Source

getKeyboard :: Effect Keyboard

Get a handle for working with the keyboard.

#down Source

down :: Effect { event :: Event String, unsubscribe :: Effect Unit }

Create an Event which fires when a key is pressed

#up Source

up :: Effect { event :: Event String, unsubscribe :: Effect Unit }

Create an Event which fires when a key is released

#withKeys Source

withKeys :: forall a. Keyboard -> Event a -> Event { keys :: Set String, value :: a }

Create an event which also returns the currently pressed keys.