helm-0.6.2: A functionally reactive game engine.

Safe HaskellNone

FRP.Helm.Keyboard

Contents

Description

Contains signals that sample input from the keyboard.

Synopsis

Types

data Key Source

A data structure describing a physical key on a keyboard.

Constructors

AKey 
BKey 
CKey 
DKey 
EKey 
FKey 
GKey 
HKey 
IKey 
JKey 
KKey 
LKey 
MKey 
NKey 
OKey 
PKey 
QKey 
RKey 
SKey 
TKey 
UKey 
VKey 
WKey 
XKey 
YKey 
ZKey 
Number1Key 
Number2Key 
Number3Key 
Number4Key 
Number5Key 
Number6Key 
Number7Key 
Number8Key 
Number9Key 
Number0Key 
ReturnKey 
EscapeKey 
BackspaceKey 
TabKey 
SpaceKey 
MinusKey 
EqualsKey 
LeftBracketKey 
RightBracketKey 
BackslashKey 
NonUSHashKey 
SemicolonKey 
ApostropheKey 
GraveKey 
CommaKey 
PeriodKey 
SlashKey 
CapslockKey 
F1Key 
F2Key 
F3Key 
F4Key 
F5Key 
F6Key 
F7Key 
F8Key 
F9Key 
F10Key 
F11Key 
F12Key 
PrintScreenKey 
ScrollLockKey 
PauseKey 
InsertKey 
HomeKey 
PageUpKey 
DeleteKey 
EndKey 
PageDownKey 
RightKey 
LeftKey 
DownKey 
UpKey 
NumLockClearKey 
KeypadDivideKey 
KeypadMultiplyKey 
KeypadMinusKey 
KeypadPlusKey 
KeypadEnterKey 
Keypad1Key 
Keypad2Key 
Keypad3Key 
Keypad4Key 
Keypad5Key 
Keypad6Key 
Keypad7Key 
Keypad8Key 
Keypad9Key 
Keypad0Key 
KeypadPeriodKey 
NonUSBackslashKey 
ApplicationKey 
PowerKey 
KeypadEqualsKey 
F13Key 
F14Key 
F15Key 
F16Key 
F17Key 
F18Key 
F19Key 
F20Key 
F21Key 
F22Key 
F23Key 
F24Key 
ExecuteKey 
HelpKey 
MenuKey 
SelectKey 
StopKey 
AgainKey 
UndoKey 
CutKey 
CopyKey 
PasteKey 
FindKey 
MuteKey 
VolumeUpKey 
VolumeDownKey 
KeypadCommaKey 
KeyPadEqualsAs400Key 
International1Key 
International2Key 
International3Key 
International4Key 
International5Key 
International6Key 
International7Key 
International8Key 
International9Key 
Lang1Key 
Lang2Key 
Lang3Key 
Lang4Key 
Lang5Key 
Lang6Key 
Lang7Key 
Lang8Key 
Lang9Key 
AltEraseKey 
SysReqKey 
CancelKey 
ClearKey 
PriorKey 
Return2Key 
SeparatorKey 
OutKey 
OperKey 
ClearAgainKey 
CrSelKey 
ExSelKey 
Keypad00Key 
Keypad000Key 
ThousandSeparatorKey 
DecimalSeparatorKey 
CurrencyUnitKey 
CurrencySubUnitKey 
KeypadLeftParenKey 
KeypadRightParenKey 
KeypadLeftBraceKey 
KeypadRightBraceKey 
KeypadTabKey 
KeypadBackspaceKey 
KeypadAKey 
KeypadBKey 
KeypadCKey 
KeypadDKey 
KeypadEKey 
KeypadFKey 
KeypadXORKey 
KeypadPowerKey 
KeypadPercentKey 
KeypadLessKey 
KeypadGreaterKey 
KeypadAmpersandKey 
KeypadDoubleAmpersandKey 
KeypadVerticalBarKey 
KeypadDoubleVerticalBarKey 
KeypadColonKey 
KeypadHashKey 
KeypadSpaceKey 
KeypadAtKey 
KeypadExclamationKey 
KeypadMemStoreKey 
KeypadMemRecallKey 
KeypadMemClearKey 
KeypadMemAddKey 
KeypadMemSubstractKey 
KeypadMemMultiplyKey 
KeypadMemDivideKey 
KeypadPlusMinusKey 
KeypadClearKey 
KeypadClearEntryKey 
KeypadBinaryKey 
KeypadOctalKey 
KeypadDecimalKey 
KeypadHexadecimalKey 
LeftControlKey 
LeftShiftKey 
LeftAltKey 
LeftMetaKey 
RightControlKey 
RightShiftKey 
RightAltKey 
RightMetaKey 
ModeKey 
AudioNextKey 
AudioPreviousKey 
AudioStopKey 
AudioPlayKey 
AudioMuteKey 
MediaSelectKey 
WWWKey 
MailKey 
CalculatorKey 
ComputerKey 
ACSearchKey 
ACHomeKey 
ACBackKey 
ACForwardKey 
ACStopKey 
ACRefreshKey 
ACBookmarksKey 
BrightnessDownKey 
BrightnessUpKey 
DisplaySwitchKey 
KeyboardIllumToggleKey 
KeyboardIllumDownKey 
KeyboardIllumUpKey 
EjectKey 
SleepKey 
App1Key 
App2Key 

Instances

Enum Key 
Eq Key 
Ord Key 
Read Key 
Show Key 

Key State

isDown :: Key -> SignalGen (Signal Bool)Source

Whether a key is pressed.

keysDown :: SignalGen (Signal [Key])Source

A list of keys that are currently being pressed.

Directions

arrows :: SignalGen (Signal (Int, Int))Source

A directional tuple combined from the arrow keys. When none of the arrow keys are being pressed this signal samples to (0, 0), otherwise it samples to a direction based on which keys are pressed. For example, pressing the left key results in (-1, 0), the down key (0, 1), up and right (1, -1), etc.

wasd :: SignalGen (Signal (Int, Int))Source

Similar to the arrows signal, but uses the popular WASD movement controls instead.