haskus-system-0.7.0.0: Haskus system programming framework

Safe HaskellNone
LanguageHaskell2010

Haskus.System.Linux.Internals.Input

Synopsis

Documentation

data Property Source #

Device properties and quirks

PropertyDirect + PropertyPointer -------------------------------- The PropertyDirect property indicates that device coordinates should be directly mapped to screen coordinates (not taking into account trivial transformations, such as scaling, flipping and rotating). Non-direct input devices require non-trivial transformation, such as absolute to relative transformation for touchpads. Typical direct input devices: touchscreens, drawing tablets; non-direct devices: touchpads, mice.

The PropertyPointer property indicates that the device is not transposed on the screen and thus requires use of an on-screen pointer to trace user's movements. Typical pointer devices: touchpads, tablets, mice; non-pointer device: touchscreen.

If neither PropertyDirect or PropertyPointer are set, the property is considered undefined and the device type should be deduced in the traditional way, using emitted event types.

PropertyButtonPad ----------------- For touchpads where the button is placed beneath the surface, such that pressing down on the pad causes a button click, this property should be set. Common in clickpad notebooks and macbooks from 2009 and onwards.

Originally, the buttonpad property was coded into the bcm5974 driver version field under the name integrated button. For backwards compatibility, both methods need to be checked in userspace.

PropertySemiMultiTouch ---------------------- Some touchpads, most common between 2008 and 2011, can detect the presence of multiple contacts without resolving the individual positions; only the number of contacts and a rectangular shape is known. For such touchpads, the semi-mt property should be set.

Depending on the device, the rectangle may enclose all touches, like a bounding box, or just some of them, for instance the two most recent touches. The diversity makes the rectangle of limited use, but some gestures can normally be extracted from it.

If PropertySemiMultiTouch is not set, the device is assumed to be a true MT device.

PropertyTopButtonPad -------------------- Some laptops, most notably the Lenovo *40 series provide a trackstick device but do not have physical buttons associated with the trackstick device. Instead, the top area of the touchpad is marked to show visual/haptic areas for left, middle, right buttons intended to be used with the trackstick.

If PropertyTopButtonPad is set, userspace should emulate buttons accordingly. This property does not affect kernel behavior. The kernel does not provide button emulation for such devices but treats them as any other PropertyButtonPad device.

PropertyAccelerometer --------------------- Directional axes on this device (absolute and/or relative x, y, z) represent accelerometer data. All other axes retain their meaning. A device must not mix regular directional axes and accelerometer axes on the same event node.

Constructors

PropertyNeedPointer

needs a pointer

PropertyDirect

direct input devices

PropertyButtonPad

has button(s) under pad

PropertySemiMultiTouch

touch rectangle only

PropertyTopButtonPad

softbuttons at top of pad

PropertyPointingStick

is a pointing stick

PropertyAccelerometer

has accelerometer

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

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

data Event Source #

Input event

Instances

Eq Event Source # 

Methods

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

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

Show Event Source # 

Methods

showsPrec :: Int -> Event -> ShowS #

show :: Event -> String #

showList :: [Event] -> ShowS #

Generic Event Source # 

Associated Types

type Rep Event :: * -> * #

Methods

from :: Event -> Rep Event x #

to :: Rep Event x -> Event #

Storable Event Source # 

Methods

peekIO :: Ptr Event -> IO Event #

pokeIO :: Ptr Event -> Event -> IO () #

alignment :: Event -> Word #

sizeOf :: Event -> Word #

type Rep Event Source # 
type Rep Event = D1 (MetaData "Event" "Haskus.System.Linux.Internals.Input" "haskus-system-0.7.0.0-FRxqghdHeI3NpHOm98r9a" False) (C1 (MetaCons "Event" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "eventTime") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 TimeVal)) (S1 (MetaSel (Just Symbol "eventType") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (EnumField Word16 EventType)))) ((:*:) (S1 (MetaSel (Just Symbol "eventCode") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word16)) (S1 (MetaSel (Just Symbol "eventValue") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int32)))))

protocolVersion :: Word Source #

Protocol version

data AbsoluteInfo Source #

Absolute info

struct input_absinfo - used by EVIOCGABS/EVIOCSABS ioctls

value: latest reported value for the axis. minimum: specifies minimum value for the axis. maximum: specifies maximum value for the axis. fuzz: specifies fuzz value that is used to filter noise from the event stream. flat: values that are within this value will be discarded by joydev interface and reported as 0 instead. resolution: specifies resolution for the values reported for the axis.

Note that input core does not clamp reported values to the [minimum, maximum] limits, such task is left to userspace.

Resolution for main axes (ABS_X, ABS_Y, ABS_Z) is reported in units per millimeter (units/mm), resolution for rotational axes (ABS_RX, ABS_RY, ABS_RZ) is reported in units per radian.

Constructors

AbsoluteInfo 

Fields

Instances

Eq AbsoluteInfo Source # 
Show AbsoluteInfo Source # 
Generic AbsoluteInfo Source # 

Associated Types

type Rep AbsoluteInfo :: * -> * #

Storable AbsoluteInfo Source # 
type Rep AbsoluteInfo Source # 

data KeymapEntry Source #

Query or modify keymap data

struct input_keymap_entry - used by EVIOCGKEYCODE/EVIOCSKEYCODE ioctls

scancode: scancode represented in machine-endian form. len: length of the scancode that resides in scancode buffer. index: index in the keymap, may be used instead of scancode flags: allows to specify how kernel should handle the request. For example, setting INPUT_KEYMAP_BY_INDEX flag indicates that kernel should perform lookup in keymap by index instead of scancode keycode: key code assigned to this scancode

The structure is used to retrieve and modify keymap data. Users have option of performing lookup either by scancode itself or by index in keymap entry. EVIOCGKEYCODE will also return scancode or index (depending on which element was used to perform lookup).

Constructors

KeymapEntry 

Fields

data EventMask Source #

Mask of events that are supported by the device

Constructors

EventMask 

Instances

Eq EventMask Source # 
Show EventMask Source # 
Generic EventMask Source # 

Associated Types

type Rep EventMask :: * -> * #

Storable EventMask Source # 
type Rep EventMask Source # 
type Rep EventMask = D1 (MetaData "EventMask" "Haskus.System.Linux.Internals.Input" "haskus-system-0.7.0.0-FRxqghdHeI3NpHOm98r9a" False) (C1 (MetaCons "EventMask" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "maskType") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word32)) ((:*:) (S1 (MetaSel (Just Symbol "maskCodesSize") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word32)) (S1 (MetaSel (Just Symbol "maskCodesPtr") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word64)))))

getVersion :: Handle -> IOErr Int Source #

Get version

EVIOCGVERSION

getDeviceInfo :: Handle -> IOErr DeviceInfo Source #

Get device info

EVIOCGID

data RepeatSettings Source #

Repeat settings

We use a structure instead of Vector 2 Word

Constructors

RepeatSettings 

getRepeatSettings :: Handle -> IOErr RepeatSettings Source #

Get repeat settings

EVIOCGREP

setRepeatSettings :: RepeatSettings -> Handle -> IOErr () Source #

Set repeat settings

EVIOCSREP

getKeyCode :: Handle -> IOErr KeymapEntry Source #

Get key code

EVIOCGKEYCODE_V2

setKeyCode :: KeymapEntry -> Handle -> IOErr () Source #

Set key code

EVIOCSKEYCODE_V2

getDeviceName :: Handle -> IOErr String Source #

Get device name

EVIOCGNAME

getDevicePhysicalLocation :: Handle -> IOErr String Source #

Get physical location

EVIOCGPHYS

getDeviceUniqueID :: Handle -> IOErr String Source #

Get unique identifier

EVIOCGUNIQ

getDeviceProperties :: Handle -> IOErr String Source #

Get device properties

EVIOCGPROP

getDeviceMultiTouchSlots :: Word32 -> Word -> Handle -> IOErr [Int32] Source #

Get multi-touch slots

EVIOCGMTSLOTS(len) - get MT slot values @len: size of the data buffer in bytes

The ioctl buffer argument should be binary equivalent to

struct input_mt_request_layout { __u32 code; __s32 values[num_slots]; };

where num_slots is the (arbitrary) number of MT slots to extract.

The ioctl size argument (len) is the size of the buffer, which should satisfy len = (num_slots + 1) * sizeof(__s32). If len is too small to fit all available slots, the first num_slots are returned.

Before the call, code is set to the wanted ABS_MT event type. On return, values[] is filled with the slot values for the specified ABS_MT code.

If the request code is not an ABS_MT value, -EINVAL is returned.

getDeviceKeys :: Word -> Handle -> IOErr Buffer Source #

Get global key state (one bit per pressed key)

EVIOCGKEY

getDeviceLEDs :: Word -> Handle -> IOErr Buffer Source #

Get all leds (one bit per led)

EVIOCGLED

getDeviceSoundStatus :: Word -> Handle -> IOErr Buffer Source #

Get sound status (one bit per sound)

EVIOCGSND

getDeviceSwitchStatus :: Word -> Handle -> IOErr Buffer Source #

Get switch status (one bit per switch)

EVIOCGSW

ioctlGetDeviceBits :: Maybe EventType -> Word -> Handle -> IOErr (Int64, Buffer) Source #

Return a bitset of the supported event codes for the given event type. If no event type is given, a bitset of the supported event types is returned instead.

Return the size of the written *bytes*

EVIOCGBIT

getDeviceAbsoluteInfo :: Word8 -> Handle -> IOErr AbsoluteInfo Source #

Get absolute info

EVIOCGABS

setDeviceAbsoluteInfo :: Word8 -> AbsoluteInfo -> Handle -> IOErr () Source #

Set absolute info

EVIOCSABS

sendForceFeedback :: ForceFeedbackEffect -> Handle -> IOErr () Source #

Send a force effect to a force feedback device

TODO: we should return the effect ID

EVIOCSFF

removeForceFeedback :: Int64 -> Handle -> IOErr () Source #

Erase a force effect

EVIOCRMFF

supportedSimultaneousEffects :: Handle -> IOErr Int Source #

Report the number of effects playable at the same time

EVIOCGEFFECTS

grabDevice :: Handle -> IOErr () Source #

Grab device

releaseDevice :: Handle -> IOErr () Source #

Release device

revokeDevice :: Handle -> IOErr () Source #

Revoke device access

EVIOCREVOKE

getEventMask :: Handle -> IOErr EventMask Source #

Get event mask (filter by type)

EVIOCGMASK - Retrieve current event mask

This ioctl allows user to retrieve the current event mask for specific event type. The argument must be of type "struct input_mask" and specifies the event type to query, the address of the receive buffer and the size of the receive buffer.

The event mask is a per-client mask that specifies which events are forwarded to the client. Each event code is represented by a single bit in the event mask. If the bit is set, the event is passed to the client normally. Otherwise, the event is filtered and will never be queued on the client's receive buffer.

Event masks do not affect global state of the input device. They only affect the file descriptor they are applied to.

The default event mask for a client has all bits set, i.e. all events are forwarded to the client. If the kernel is queried for an unknown event type or if the receive buffer is larger than the number of event codes known to the kernel, the kernel returns all zeroes for those codes.

At maximum, codes_size bytes are copied.

This ioctl may fail with ENODEV in case the file is revoked, EFAULT if the receive-buffer points to invalid memory, or EINVAL if the kernel does not implement the ioctl.

setEventMask :: EventMask -> Handle -> IOErr () Source #

Set event mask (event filter by type)

EVIOCSMASK - Set event mask

This ioctl is the counterpart to EVIOCGMASK. Instead of receiving the current event mask, this changes the client's event mask for a specific type. See EVIOCGMASK for a description of event-masks and the argument-type.

This ioctl provides full forward compatibility. If the passed event type is unknown to the kernel, or if the number of event codes specified in the mask is bigger than what is known to the kernel, the ioctl is still accepted and applied. However, any unknown codes are left untouched and stay cleared. That means, the kernel always filters unknown codes regardless of what the client requests. If the new mask doesn't cover all known event-codes, all remaining codes are automatically cleared and thus filtered.

This ioctl may fail with ENODEV in case the file is revoked. EFAULT is returned if the receive-buffer points to invalid memory. EINVAL is returned if the kernel does not implement the ioctl.

setDeviceClock :: Clock -> Handle -> IOErr () Source #

Set clock to use for timestamps

EVIOCCLOCKID

data ForceFeedbackReplay Source #

Defines scheduling of the force-feedback effect

Constructors

ForceFeedbackReplay 

Fields

data ForceFeedbackTrigger Source #

Defines what triggers the force-feedback effect

Constructors

ForceFeedbackTrigger 

Fields

data ForceFeedbackEnvelope Source #

Generic force-feedback effect envelope

The attack_level and fade_level are absolute values; when applying envelope force-feedback core will convert to positive/negative value based on polarity of the default level of the effect. Valid range for the attack and fade levels is 0x0000 - 0x7fff

Constructors

ForceFeedbackEnvelope 

Fields

Instances

Eq ForceFeedbackEnvelope Source # 
Show ForceFeedbackEnvelope Source # 
Generic ForceFeedbackEnvelope Source # 
Storable ForceFeedbackEnvelope Source # 
type Rep ForceFeedbackEnvelope Source # 
type Rep ForceFeedbackEnvelope = D1 (MetaData "ForceFeedbackEnvelope" "Haskus.System.Linux.Internals.Input" "haskus-system-0.7.0.0-FRxqghdHeI3NpHOm98r9a" False) (C1 (MetaCons "ForceFeedbackEnvelope" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "ffEnvelopeAttackLength") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word16)) (S1 (MetaSel (Just Symbol "ffEnvelopeAttackLevel") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word16))) ((:*:) (S1 (MetaSel (Just Symbol "ffEnvelopeFadeLength") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word16)) (S1 (MetaSel (Just Symbol "ffEnvelopeFadeLevel") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word16)))))

data ForceFeedbackConstantEffect Source #

Defines parameters of a constant force-feedback effect

Constructors

ForceFeedbackConstantEffect 

Fields

Instances

Eq ForceFeedbackConstantEffect Source # 
Show ForceFeedbackConstantEffect Source # 
Generic ForceFeedbackConstantEffect Source # 
Storable ForceFeedbackConstantEffect Source # 
type Rep ForceFeedbackConstantEffect Source # 
type Rep ForceFeedbackConstantEffect = D1 (MetaData "ForceFeedbackConstantEffect" "Haskus.System.Linux.Internals.Input" "haskus-system-0.7.0.0-FRxqghdHeI3NpHOm98r9a" False) (C1 (MetaCons "ForceFeedbackConstantEffect" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "ffConstantEffectLevel") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int16)) (S1 (MetaSel (Just Symbol "ffConstantEffectEnvelope") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ForceFeedbackEnvelope))))

data ForceFeedbackRampEffect Source #

Defines parameters of a ramp force-feedback effect

Constructors

ForceFeedbackRampEffect 

Fields

Instances

Eq ForceFeedbackRampEffect Source # 
Show ForceFeedbackRampEffect Source # 
Generic ForceFeedbackRampEffect Source # 
Storable ForceFeedbackRampEffect Source # 
type Rep ForceFeedbackRampEffect Source # 
type Rep ForceFeedbackRampEffect = D1 (MetaData "ForceFeedbackRampEffect" "Haskus.System.Linux.Internals.Input" "haskus-system-0.7.0.0-FRxqghdHeI3NpHOm98r9a" False) (C1 (MetaCons "ForceFeedbackRampEffect" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "ffRampEffectStartLevel") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int16)) ((:*:) (S1 (MetaSel (Just Symbol "ffRampEffectEndLevel") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int16)) (S1 (MetaSel (Just Symbol "ffRampEffectEnvelope") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ForceFeedbackEnvelope)))))

data ForceFeedbackConditionEffect Source #

Defines a spring or friction force-feedback effect

Constructors

ForceFeedbackConditionEffect 

Fields

Instances

Eq ForceFeedbackConditionEffect Source # 
Show ForceFeedbackConditionEffect Source # 
Generic ForceFeedbackConditionEffect Source # 
Storable ForceFeedbackConditionEffect Source # 
type Rep ForceFeedbackConditionEffect Source # 
type Rep ForceFeedbackConditionEffect = D1 (MetaData "ForceFeedbackConditionEffect" "Haskus.System.Linux.Internals.Input" "haskus-system-0.7.0.0-FRxqghdHeI3NpHOm98r9a" False) (C1 (MetaCons "ForceFeedbackConditionEffect" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "ffConditionEffectRightSaturation") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word16)) ((:*:) (S1 (MetaSel (Just Symbol "ffConditionEffectLeftSaturation") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word16)) (S1 (MetaSel (Just Symbol "ffConditionEffectRightCoeff") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int16)))) ((:*:) (S1 (MetaSel (Just Symbol "ffConditionEffectLeftCoeff") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int16)) ((:*:) (S1 (MetaSel (Just Symbol "ffConditionEffectDeadBand") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word16)) (S1 (MetaSel (Just Symbol "ffConditionEffectCenter") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int16))))))

data ForceFeedbackPeriodicEffect Source #

Defines parameters of a periodic force-feedback effect Known waveforms - FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP, FF_SAW_DOWN, FF_CUSTOM. The exact syntax FF_CUSTOM is undefined for the time being as no driver supports it yet.

Note: the data pointed by custom_data is copied by the driver. You can therefore dispose of the memory after the upload/update.

Constructors

ForceFeedbackPeriodicEffect 

Fields

Instances

Eq ForceFeedbackPeriodicEffect Source # 
Show ForceFeedbackPeriodicEffect Source # 
Generic ForceFeedbackPeriodicEffect Source # 
Storable ForceFeedbackPeriodicEffect Source # 
type Rep ForceFeedbackPeriodicEffect Source # 
type Rep ForceFeedbackPeriodicEffect = D1 (MetaData "ForceFeedbackPeriodicEffect" "Haskus.System.Linux.Internals.Input" "haskus-system-0.7.0.0-FRxqghdHeI3NpHOm98r9a" False) (C1 (MetaCons "ForceFeedbackPeriodicEffect" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "ffPeriodicEffectWaveform") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (EnumField Word16 ForceFeedbackPeriodicEffectType))) (S1 (MetaSel (Just Symbol "ffPeriodicEffectPeriod") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word16))) ((:*:) (S1 (MetaSel (Just Symbol "ffPeriodicEffectMagnitude") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int16)) (S1 (MetaSel (Just Symbol "ffPeriodicEffectOffset") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int16)))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "ffPeriodicEffectPhase") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word16)) (S1 (MetaSel (Just Symbol "ffPeriodicEffectEnvelope") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 ForceFeedbackEnvelope))) ((:*:) (S1 (MetaSel (Just Symbol "ffPeriodicEffectCustomLen") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Word32)) (S1 (MetaSel (Just Symbol "ffPeriodicEffectCustomData") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (Ptr Int16)))))))

data ForceFeedbackRumbleEffect Source #

Defines parameters of a periodic force-feedback effect

Some rumble pads have two motors of different weight. Strong_magnitude represents the magnitude of the vibration generated by the heavy one.

Constructors

ForceFeedbackRumbleEffect 

Fields

data ForceFeedbackEffect Source #

Force feedback effect

struct ff_effect - defines force feedback effect type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING, FF_FRICTION, FF_DAMPER, FF_RUMBLE, FF_INERTIA, or FF_CUSTOM) id: an unique id assigned to an effect direction: direction of the effect trigger: trigger conditions (struct ff_trigger) replay: scheduling of the effect (struct ff_replay) u: effect-specific structure (one of ff_constant_effect, ff_ramp_effect, ff_periodic_effect, ff_condition_effect, ff_rumble_effect) further defining effect parameters

This structure is sent through ioctl from the application to the driver. To create a new effect application should set its id to -1; the kernel will return assigned id which can later be used to update or delete this effect.

Direction of the effect is encoded as follows: 0 deg -> 0x0000 (down) 90 deg -> 0x4000 (left) 180 deg -> 0x8000 (up) 270 deg -> 0xC000 (right)

Instances

Show ForceFeedbackEffect Source # 
Generic ForceFeedbackEffect Source # 
Storable ForceFeedbackEffect Source # 
type Rep ForceFeedbackEffect Source # 

data ForceFeedbackPeriodicEffectType Source #

Force feedback periodic effect types

Constructors

Square 
Triangle 
Sine 
SawUp 
SawDown 
Custom