haskus-system-0.7.0.0: Haskus system programming framework

Safe HaskellNone
LanguageHaskell2010

Haskus.System.Input

Description

Manage input devices

Synopsis

Documentation

data InputDevice Source #

Input device

Constructors

InputDevice 

data EventType Source #

Event types

Constructors

EventTypeSync

Marker to separate events

EventTypeKey

State changes of keyboards, button, etc.

EventTypeRelative

Relative axis changes

EventTypeAbsolute

Absolute axis changes

EventTypeMisc

Miscellaneous

EventTypeSwitch

Binary state switch

EventTypeLED

Turn LEDs on and off

EventTypeSound

Output sound to devices

EventTypeReplay

Auto-repeating devices

EventTypeForceFeedback

Send force-feedback to an input device

EventTypePower

Power button and switch

EventTypeForceFeedbackStatus

Receive force-feedback status

loadInputDevices :: DeviceManager -> Sys [InputDevice] Source #

List and load devices with the "input" class

newtype InputEventBundle Source #

Bundle of events

Evdev sends a series of input events to describe a single "action" (e.g., if a mouse is moved diagonaly, there will be one event for each axis), then it sends a synchronization event. We bundle these events into a single InputEventBundle.

newInputEventHandler :: TChan Event -> Sys (TChan InputEventBundle) Source #

Convert a stream a input events into a stream of input event bundles

Note: maybe we could in the future totally get rid of the channel of events to only keep the channel of event bundles. It would avoid going through an intermediate channel (current implementation, that could be improved too). For now, we keep the event channel, mostly for debugging purpose. We would also need to check that it doesn't increase the number of dropped synchronization events.

TODO: handle SyncDropped (reader not fast enough to read kernel generated events, leading the kernel to drop events)

data SyncEventType Source #

Synchronization events

Constructors

SyncReport

Separate events into packets of events occuring at the same time

SyncConfig 
SyncMultiTouchReport

Separate touch events

SyncDropped

Buffer overrun: client should ignore all events up to the next SyncReport and query the device to obtain its current state

data Key Source #

Keys

Constructors

ReservedKey 
Esc 
Key1 
Key2 
Key3 
Key4 
Key5 
Key6 
Key7 
Key8 
Key9 
Key0 
Minus 
Equal 
BackSpace 
Tab 
Q 
W 
E 
R 
T 
Y 
U 
I 
O 
P 
LeftBrace 
RightBrace 
Enter 
LeftCtrl 
A 
S 
D 
F 
G 
H 
J 
K 
L 
SemiColon 
Apostrophe 
Grave 
LeftShift 
BackSlash 
Z 
X 
C 
V 
B 
N 
M 
Comma 
Dot 
Slash 
RightShift 
KeyPadAsterisk 
LeftAlt 
Space 
CapsLock 
F1 
F2 
F3 
F4 
F5 
F6 
F7 
F8 
F9 
F10 
NumLock 
SCrollLock 
KeyPad7 
KeyPad8 
KeyPad9 
KeyPadMinus 
KeyPad4 
KeyPad5 
KeyPad6 
KeyPadPlus 
KeyPad1 
KeyPad2 
KeyPad3 
KeyPad0 
KeyPadDot 
Zenkakuhankaku 
Key102ND 
F11 
F12 
RO 
Katakana 
Hiragana 
Henkan 
KatakanaHiragana 
Muhenkan 
KeyPadJPComma 
KeyPadEnter 
RightCtrl 
KeyPadSlash 
SysRq 
RightAlt 
LineFeed 
Home 
Up 
PageUp 
KeyLeft 
KeyRight 
End 
Down 
PageDown 
Insert 
Delete 
Macro 
Mute 
VolumeDown 
VolumeUp 
Power

System Power Down

KeyPadEqual 
KeyPadPlusMinus 
Pause 
Scale

Compiz Scale (Expose)

KeyPadComma 
Hangeul 
Hanja 
Yen 
LeftMeta 
RightMeta 
Compose 
Stop 
Again 
Properties 
Undo 
Front 
Copy 
Open 
Paste 
Find 
Cut 
Help 
Menu 
Calc 
Setup 
Sleep 
WakeUp 
File 
SendFile 
DeleteFile 
Transfer 
Prog1 
Prog2 
Web 
MsDos 
ScreenLock 
RotateDisplay

Display orientation for e.g. tablets

CycleWindows 
Mail 
Bookmarks 
Computer 
Back 
Forward 
CloseCD 
EjectCD 
EjectCloseCD 
NextSong 
PlayPause 
PreviousSong 
StopCD 
Record 
Rewind 
Phone

Media Select Telephone

ISO 
Config

Consumer Control Configuration

HomePage 
Refresh 
Exit 
Move 
Edit 
ScrollUp 
ScrollDown 
KeyPadLeftParen 
KeypadRightParen 
New 
Redo 
F13 
F14 
F15 
F16 
F17 
F18 
F19 
F20 
F21 
F22 
F23 
F24 
PlayCD 
PauseCD 
Prog3 
Prog4 
DashBoard 
Suspend 
Close 
Play 
FastForward 
BassBoost 
Print 
HP 
Camera 
Sound 
Question 
Email 
Chat 
Search 
Connect 
Finance 
Sport 
Shop 
AltErase 
Cancel 
BrightnessDown 
BrightnessUp 
Media 
SwitchVideoMode

Cycle between available video outputs (MonitorLCDTV-out/etc)

KbdIllumToggle 
KbdIllumDown 
KbdIllumUp 
Send 
Reply 
ForwardMail 
Save 
Documents 
Battery 
BlueTooth 
WLAN 
UWB 
Unknown 
VideoNext

drive next video source

VideoPrev

drive previous video source

BrightnessCycle

brightness up, after max is min

BrightnessAuto

Set Auto Brightness: manual brightness control is off, rely on ambient

DisplayOff

display device to off state

WWAN

Wireless WAN (LTE, UMTS, GSM, etc.)

RfKill

Key that controls all radios

MicMute

Mute / unmute the microphone

Button0 
Button1 
Button2 
Button3 
Button4 
Button5 
Button6 
Button7 
Button8 
Button9 
MouseLeft 
MouseRight 
MouseMiddle 
MouseSide 
MouseExtra 
MouseForward 
MouseBack 
MouseTask 
JoystickTrigger 
JoystickThumb 
JoystickThumb2 
JoystickTop 
JoystickTop2 
JoystickPinkie 
JoystickBase 
JoystickBase2 
JoystickBase3 
JoystickBase4 
JoystickBase5 
JoystickBase6 
JoystickDead 
GamePadA 
GamePadB 
GamePadC 
GamePadX 
GamePadY 
GamePadZ 
GamePadTL 
GamePadTR 
GamePadTL2 
GamePadTR2 
GamePadSelect 
GamePadStart 
GamePadMode 
GamePadThumbL 
GamePadThumbR 
DigitalToolPen 
DigitalToolRubber 
DigitalToolBrush 
DigitalToolPencil 
DigitalToolAirbrush 
DigitalToolFinger 
DigitalToolMouse 
DigitalToolLens 
DigitalToolQuintTap 
DigitalTouch 
DigitalStylus 
DigitalStylus2 
DigitalToolDoubleTap 
DigitalToolTripleTap 
DigitalToolQuadTap 
WheelDown 
WheelUp 
Ok 
Select 
Goto 
Clear 
Power2 
Option 
Info 
Time 
Vendor 
Archive 
Program 
Channel 
Favorites 
EPG 
PVR 
MHP 
Language 
Title 
Subtitle 
Angle 
Zoom 
Mode 
Appboard 
Screen 
PC 
TV 
TV2 
VCR 
VCR2 
SAT 
SAT2 
CD 
Tape 
Radio 
Tuner 
Player 
Text 
DVD 
Aux 
MP3 
Audio 
Video 
Directory 
List 
Memo 
Calendar 
Red 
Green 
Yellow 
Blue 
ChannelUp 
ChannelDown 
First 
Last 
AB 
Next 
Restart 
Slow 
Shuffle 
Break 
Previous 
Digits 
Teen 
Twen 
VideoPhone 
Games 
ZoomIn 
ZoomOut 
ZoomReset 
WordProcessor 
Editor 
Spreadsheet 
GraphicsEditor 
Presentation 
DataBase 
News 
VoiceMail 
AddressBook 
Messenger 
DisplayToggle 
SpellCheck 
LogOff 
Dollar 
Euro 
FrameBack 
FrameForward 
ContextMenu 
MediaRepeat 
Key10ChannelsUp 
Key10ChennelsDown 
Images 
DeleteEndOfLine 
DeleteEOS 
InsertLine 
DeleteLine 
FN 
FNEsc 
FNF1 
FNF2 
FNF3 
FNF4 
FNF5 
FNF6 
FNF7 
FNF8 
FNF9 
FNF10 
FNF11 
FNF12 
FN1 
FN2 
FND 
FNE 
FNF 
FNS 
FNB 
BrailleDot1 
BrailleDot2 
BrailleDot3 
BrailleDot4 
BrailleDot5 
BrailleDot6 
BrailleDot7 
BrailleDot8 
BrailleDot9 
BrailleDot10 
Numeric0 
Numeric1 
Numeric2 
Numeric3 
Numeric4 
Numeric5 
Numeric6 
Numeric7 
Numeric8 
Numeric9 
NumericStar 
NumericPound 
NumericA 
NumericB 
NumericC 
NumericD 
KeyCameraFocus 
KeyWifiProtectedSetup 
KeyTouchPadToggle 
KeyTouchPadOn 
KeyTouchPadOff 
CameraZoomIn 
CameraZoomOut 
CameraUp 
CameraDown 
CameraLeft 
CameraRight 
AttendantOn 
AttendantOff 
AttendantToggle 
LightsToggle 
DPadUp 
DPadDown 
DPadLeft 
DPadRight 
AmbientLightSensorToggle 
ButtonConfig 
TaskManager 
Journal 
ControlPanel 
AppsSelect 
ScreenSaver 
VoiceCommand 
BrightnessMin 
BrightnessMax 
KBDInputAssistPrev 
KBDInputAssistNext 
KBDInputAssistPrevGroup 
KBDInputAssistNextGroup 
KBDInputAssistAccept 
KBDInputAssistCancel 
RightUp 
RightDown 
LeftUp 
LeftDown 
RootMenu 
MediaTopMenu 
Numeric11 
Numeric12 
ToggleAudioDesc

Toggle Audio Description: refers to an audio service that helps blind and visually impaired consumers understand the action in a program. Note: in some countries this is referred to as "Video Description".

Toggle3DMode 
NextFavorite 
StopRecord 
PauseRecord 
VideoOnDemand 
UnMute 
FastReverse 
SlowReverse 
TriggerHappy1 
TriggerHappy2 
TriggerHappy3 
TriggerHappy4 
TriggerHappy5 
TriggerHappy6 
TriggerHappy7 
TriggerHappy8 
TriggerHappy9 
TriggerHappy10 
TriggerHappy11 
TriggerHappy12 
TriggerHappy13 
TriggerHappy14 
TriggerHappy15 
TriggerHappy16 
TriggerHappy17 
TriggerHappy18 
TriggerHappy19 
TriggerHappy20 
TriggerHappy21 
TriggerHappy22 
TriggerHappy23 
TriggerHappy24 
TriggerHappy25 
TriggerHappy26 
TriggerHappy27 
TriggerHappy28 
TriggerHappy29 
TriggerHappy30 
TriggerHappy31 
TriggerHappy32 
TriggerHappy33 
TriggerHappy34 
TriggerHappy35 
TriggerHappy36 
TriggerHappy37 
TriggerHappy38 
TriggerHappy39 
TriggerHappy40 
CustomKey Word16 

Instances

Eq Key Source # 

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Data Key Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Key -> c Key #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Key #

toConstr :: Key -> Constr #

dataTypeOf :: Key -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Key) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Key) #

gmapT :: (forall b. Data b => b -> b) -> Key -> Key #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Key -> r #

gmapQ :: (forall d. Data d => d -> u) -> Key -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Key -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Key -> m Key #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Key -> m Key #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Key -> m Key #

Show Key Source # 

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

CEnum Key Source # 

Methods

fromCEnum :: Integral b => Key -> b #

toCEnum :: Integral b => b -> Key #

data AbsoluteAxe Source #

Absolute axes

data SwitchEventType Source #

Switch events

Constructors

SwitchLID

set = LID shut

SwitchTabletMode

set = tablet mode

SwitchHeadphoneInsert

set = inserted

SwitchRFKillAll

rfkill master switch, type "any" set = radio enabled

SwitchMicroPhoneInsert

set = inserted

SwitchDock

set = plugged into dock

SwitchLineOutInsert

set = inserted

SwitchJackPhysicalInsert

set = mechanical switch set

SwitchVideoOutInsert

set = inserted

SwitchCameraLensCover

set = lens covered

SwitchKeypadSlide

set = keypad slide out

SwitchFrontProximity

set = front proximity sensor active

SwitchRotateLock

set = rotate locked/disabled

SwitchLineInInsert

set = inserted

SwitchMuteDevice

set = device disabled

data LED Source #

LEDs

Instances

Enum LED Source # 

Methods

succ :: LED -> LED #

pred :: LED -> LED #

toEnum :: Int -> LED #

fromEnum :: LED -> Int #

enumFrom :: LED -> [LED] #

enumFromThen :: LED -> LED -> [LED] #

enumFromTo :: LED -> LED -> [LED] #

enumFromThenTo :: LED -> LED -> LED -> [LED] #

Eq LED Source # 

Methods

(==) :: LED -> LED -> Bool #

(/=) :: LED -> LED -> Bool #

Show LED Source # 

Methods

showsPrec :: Int -> LED -> ShowS #

show :: LED -> String #

showList :: [LED] -> ShowS #

CEnum LED Source # 

Methods

fromCEnum :: Integral b => LED -> b #

toCEnum :: Integral b => b -> LED #

data Sound Source #

Sounds