# \[ANN\] Joysticks.jl Version 0.1.3

**URL:** <https://discourse.julialang.org/t/ann-joysticks-jl-version-0-1-3/81749>\
**Category:** Package Announcements\
**Tags:** package, announcement, control, input-output\
**Created:** [May 26, 2022, 10:40pm UTC](https://discourse.julialang.org/t/ann-joysticks-jl-version-0-1-3/81749 "2022-05-26T22:40:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [May 26, 2022, 10:40pm UTC](https://discourse.julialang.org/t/ann-joysticks-jl-version-0-1-3/81749/1 "2022-05-26T22:40:16Z")

</div>

**[Joystick interface for Julia](https://github.com/ufechner7/Joysticks.jl)**

This is the first version that is cross-platform and tested on Windows and Linux.  
It should also work on Mac, but I cannot test that (voluteers welcome).

Compared to using the bare Joystick driver from GLFW.jl it has the following advantages:

- a deadzone was added to make sure you get zero output in neutral position
- the buttons are connected to observables from Observable.jl which makes it very  
easy to call a function when a button is pressed and/or released.

**Basic usage**

```julia
using Joysticks, Observables

const js = open_joystick()
const jsaxes = JSState()
const jsbuttons = JSButtonState()

async_read!(js, jsaxes, jsbuttons)

on(jsbuttons.btn1) do val
    if val println("Button 1 pressed!") end
end
on(jsbuttons.btn2) do val
    if ! val println("Button 2 released!") end
end

while true
    println(jsaxes)
    sleep(0.05)
end

```

I tested it on Windows and Linux and it works for me, but probably not for  
every configuration, so if you could test it and give feedback that would  
be nice.

Thanks a lot to the community for the support and thanks to José Joaquín Zubieta Rico  
for the initial implementation. 🙂
