Loading README.md +60 −53 Original line number Diff line number Diff line Loading @@ -6,26 +6,30 @@ uses Linux kernel 'input' interface, available on a wide range of linux devices, uses go channels to pipe around events, for flexibility and multi-threading. # Operation ## Operation make event channels from methods on HID type. 'HID.On***()' make event channels from methods on HID type. `HID.On<<event>>()` also some higher-level event modifiers for common UI abstractions, to help standard usage. Overview/docs: [](https://godoc.org/github.com/splace/joysticks) # Installation: ## Installation: go get github.com/splace/joysticks # Examples: ## Examples: highlevel (automates Connect,device event chan creation and Parcelling out events): ### highlevel simply block until button one pressed. automates Connect, device event chan creation and Parcelling out events ```` Go // block until button one pressed. package main import . "github.com/splace/joysticks" func main() { Loading @@ -34,12 +38,15 @@ simply block until button one pressed. ) <-evts[0] } ```` ### Midlevel Midlevel (allows device interrogation and event re-assigning.) log description of events when pressing button #1 or moving hat#1.(with 10sec timeout.) allows device interrogation and event re-assigning. ```` Go // log description of events when pressing button #1 or moving hat#1. // 10sec timeout. package main import . "github.com/splace/joysticks" Loading Loading @@ -82,7 +89,7 @@ log description of events when pressing button #1 or moving hat#1.(with 10sec ti time.Sleep(time.Second*10) log.Println("Shutting down due to timeout.") } ```` Note: "jstest-gtk" - gtk mapping and calibration for joysticks. Loading Loading
README.md +60 −53 Original line number Diff line number Diff line Loading @@ -6,26 +6,30 @@ uses Linux kernel 'input' interface, available on a wide range of linux devices, uses go channels to pipe around events, for flexibility and multi-threading. # Operation ## Operation make event channels from methods on HID type. 'HID.On***()' make event channels from methods on HID type. `HID.On<<event>>()` also some higher-level event modifiers for common UI abstractions, to help standard usage. Overview/docs: [](https://godoc.org/github.com/splace/joysticks) # Installation: ## Installation: go get github.com/splace/joysticks # Examples: ## Examples: highlevel (automates Connect,device event chan creation and Parcelling out events): ### highlevel simply block until button one pressed. automates Connect, device event chan creation and Parcelling out events ```` Go // block until button one pressed. package main import . "github.com/splace/joysticks" func main() { Loading @@ -34,12 +38,15 @@ simply block until button one pressed. ) <-evts[0] } ```` ### Midlevel Midlevel (allows device interrogation and event re-assigning.) log description of events when pressing button #1 or moving hat#1.(with 10sec timeout.) allows device interrogation and event re-assigning. ```` Go // log description of events when pressing button #1 or moving hat#1. // 10sec timeout. package main import . "github.com/splace/joysticks" Loading Loading @@ -82,7 +89,7 @@ log description of events when pressing button #1 or moving hat#1.(with 10sec ti time.Sleep(time.Second*10) log.Println("Shutting down due to timeout.") } ```` Note: "jstest-gtk" - gtk mapping and calibration for joysticks. Loading