Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Evdev.Uinput
Contents
Description
Create virtual input devices.
Synopsis
- data Device
- newDevice :: ByteString -> DeviceOpts -> IO Device
- writeEvent :: Device -> EventData -> IO ()
- writeBatch :: Foldable t => Device -> t EventData -> IO ()
- data DeviceOpts = DeviceOpts {
- phys :: Maybe ByteString
- uniq :: Maybe ByteString
- idProduct :: Maybe Int
- idVendor :: Maybe Int
- idBustype :: Maybe Int
- idVersion :: Maybe Int
- keys :: [Key]
- relAxes :: [RelativeAxis]
- absAxes :: [(AbsoluteAxis, AbsInfo)]
- miscs :: [MiscEvent]
- switchs :: [SwitchEvent]
- leds :: [LEDEvent]
- sounds :: [SoundEvent]
- reps :: [(RepeatEvent, Int)]
- ffs :: [EventCode]
- powers :: [EventCode]
- ffStats :: [EventCode]
- defaultDeviceOpts :: DeviceOpts
- deviceOptsFromEvents :: Maybe (AbsoluteAxis -> AbsInfo) -> Maybe (RepeatEvent -> Int) -> [EventData] -> DeviceOpts
- deviceSyspath :: Device -> IO (Maybe ByteString)
- deviceDevnode :: Device -> IO (Maybe ByteString)
- data AbsInfo = AbsInfo {
- absValue :: Int32
- absMinimum :: Int32
- absMaximum :: Int32
- absFuzz :: Int32
- absFlat :: Int32
- absResolution :: Int32
- data Event = Event {}
- data EventData
- = SyncEvent SyncEvent
- | KeyEvent Key KeyEvent
- | RelativeEvent RelativeAxis EventValue
- | AbsoluteEvent AbsoluteAxis EventValue
- | MiscEvent MiscEvent EventValue
- | SwitchEvent SwitchEvent EventValue
- | LEDEvent LEDEvent EventValue
- | SoundEvent SoundEvent EventValue
- | RepeatEvent RepeatEvent EventValue
- | ForceFeedbackEvent EventCode EventValue
- | PowerEvent EventCode EventValue
- | ForceFeedbackStatusEvent EventCode EventValue
- | UnknownEvent Word16 EventCode EventValue
- data KeyEvent
- newtype EventCode = EventCode Word16
- newtype EventValue = EventValue Int32
Documentation
Arguments
:: ByteString | Device name |
-> DeviceOpts | |
-> IO Device |
Create a new uinput
device.
writeEvent :: Device -> EventData -> IO () Source #
Write a single event. Doesn't issue a sync event, so: writeEvent dev e /= writeBatch dev [e]
.
writeBatch :: Foldable t => Device -> t EventData -> IO () Source #
Write several events followed by a SynReport
.
data DeviceOpts Source #
Constructors
DeviceOpts | |
Fields
|
deviceOptsFromEvents :: Maybe (AbsoluteAxis -> AbsInfo) -> Maybe (RepeatEvent -> Int) -> [EventData] -> DeviceOpts Source #
Make options for a device capable of precisely the events in the list.
deviceSyspath :: Device -> IO (Maybe ByteString) Source #
deviceDevnode :: Device -> IO (Maybe ByteString) Source #
Re-exports from Evdev
Constructors
AbsInfo | |
Fields
|
An input event, including the timestamp.
An input event, without the timestamp.
Each constructor corresponds to one event type, except for UnknownEvent
.
Constructors
SyncEvent SyncEvent | |
KeyEvent Key KeyEvent | |
RelativeEvent RelativeAxis EventValue | |
AbsoluteEvent AbsoluteAxis EventValue | |
MiscEvent MiscEvent EventValue | |
SwitchEvent SwitchEvent EventValue | |
LEDEvent LEDEvent EventValue | |
SoundEvent SoundEvent EventValue | |
RepeatEvent RepeatEvent EventValue | |
ForceFeedbackEvent EventCode EventValue | |
PowerEvent EventCode EventValue | |
ForceFeedbackStatusEvent EventCode EventValue | |
UnknownEvent Word16 EventCode EventValue | We include this primarily so that |
Instances
Read EventData Source # | |
Show EventData Source # | |
Eq EventData Source # | |
Ord EventData Source # | |
The status of a key.
Instances
Bounded KeyEvent Source # | |
Enum KeyEvent Source # | |
Read KeyEvent Source # | |
Show KeyEvent Source # | |
Eq KeyEvent Source # | |
Ord KeyEvent Source # | |
Defined in Evdev |
A direct representation of the code field of the C input_event, for when there is no obvious meaningful sum type.
Instances
Enum EventCode Source # | |
Defined in Evdev Methods succ :: EventCode -> EventCode # pred :: EventCode -> EventCode # fromEnum :: EventCode -> Int # enumFrom :: EventCode -> [EventCode] # enumFromThen :: EventCode -> EventCode -> [EventCode] # enumFromTo :: EventCode -> EventCode -> [EventCode] # enumFromThenTo :: EventCode -> EventCode -> EventCode -> [EventCode] # | |
Read EventCode Source # | |
Show EventCode Source # | |
Eq EventCode Source # | |
Ord EventCode Source # | |
newtype EventValue Source #
A direct representation of the value field of the C input_event, for when there is no obvious meaningful sum type.
Constructors
EventValue Int32 |