Copyright | (c) 2016-19 Brian W Bush |
---|---|
License | MIT |
Maintainer | Brian W Bush <code@functionally.io> |
Stability | Stable |
Portability | Portable |
Safe Haskell | None |
Language | Haskell2010 |
Interaction with Leap Motion <https://www.leapmotion.com/product/desktop>, based on the Web Socket API <https://developer.leapmotion.com/documentation/javascript/supplements/Leap_JSON.html>.
Here is a simple example applicaton that prints all events:
main :: IO () main = runWithHandler def [setFocused True, setGestures True] $ event -> print (event :: Event Float)
Synopsis
- data Configuration = Configuration {}
- data Version = Version {
- serviceVersion :: String
- version :: Int
- setBackground :: Bool -> ConnectionModifier
- setFocused :: Bool -> ConnectionModifier
- setGestures :: Bool -> ConnectionModifier
- setOptimizedHMD :: Bool -> ConnectionModifier
- type ClientApp a = Connection -> IO a
- type Handler a = Event a -> IO ()
- run :: Configuration -> ClientApp a -> IO a
- runWithHandler :: FromJSON a => Configuration -> [ConnectionModifier] -> Handler a -> IO ()
Configuration
data Configuration Source #
Configuration for a connection to a Leap Motion controller via Web Sockets.
Instances
Eq Configuration Source # | |
Defined in System.Hardware.Leap (==) :: Configuration -> Configuration -> Bool # (/=) :: Configuration -> Configuration -> Bool # | |
Ord Configuration Source # | |
Defined in System.Hardware.Leap compare :: Configuration -> Configuration -> Ordering # (<) :: Configuration -> Configuration -> Bool # (<=) :: Configuration -> Configuration -> Bool # (>) :: Configuration -> Configuration -> Bool # (>=) :: Configuration -> Configuration -> Bool # max :: Configuration -> Configuration -> Configuration # min :: Configuration -> Configuration -> Configuration # | |
Read Configuration Source # | |
Defined in System.Hardware.Leap readsPrec :: Int -> ReadS Configuration # readList :: ReadS [Configuration] # | |
Show Configuration Source # | |
Defined in System.Hardware.Leap showsPrec :: Int -> Configuration -> ShowS # show :: Configuration -> String # showList :: [Configuration] -> ShowS # | |
Default Configuration Source # | |
Defined in System.Hardware.Leap def :: Configuration # |
Version information for Leap Motion.
Version | |
|
:: Bool | Whether to enable background events. |
-> ConnectionModifier | Function for making the modification. |
Enable or disable background events. See <https://developer.leapmotion.com/documentation/javascript/supplements/Leap_JSON.html> for details.
:: Bool | Whether to enable focus. |
-> ConnectionModifier | Function for making the modification. |
Enable or disable focus. See <https://developer.leapmotion.com/documentation/javascript/supplements/Leap_JSON.html> for details.
:: Bool | Whether to enable gestiure events. |
-> ConnectionModifier | Function for making the modification. |
Enable or disable gestures. See <https://developer.leapmotion.com/documentation/javascript/supplements/Leap_JSON.html> for details.
:: Bool | Whether to enable HMD optimization. |
-> ConnectionModifier | Function for making the modification. |
Enable or disable head-mounted-display optimization. See <https://developer.leapmotion.com/documentation/javascript/supplements/Leap_JSON.html> for details.
Applications
= Connection | The Web Socet connection. |
-> IO a | Action for the client application. |
A client application for Leap Motion using Web Sockets.
A handler for Leap Motion events.
:: Configuration | The Web Socket configuration. |
-> ClientApp a | The client application. |
-> IO a | Action for running the client. |
Run a Leap Motion application using Web Sockets.
:: FromJSON a | |
=> Configuration | The Web Socket configuration. |
-> [ConnectionModifier] | Modifications to be made to the connection. |
-> Handler a | The event handler. |
-> IO () | Action for running with event handling. |
Run and process events from Leap Motion using Web Sockets.