# Read Joystick from Julia

**URL:** <https://discourse.julialang.org/t/read-joystick-from-julia/81325>\
**Category:** General Usage\
**Tags:** question\
**Created:** [May 19, 2022, 6:59pm UTC](https://discourse.julialang.org/t/read-joystick-from-julia/81325 "2022-05-19T18:59:02Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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 19, 2022, 10:05pm UTC](https://discourse.julialang.org/t/read-joystick-from-julia/81325/4 "2022-05-19T22:05:18Z")

</div>

How would you translate this to Julia:

```julia
size_t get_axis_count(int fd)
{
    __u8 axes;

    if (ioctl(fd, JSIOCGAXES, &axes) == -1)
        return 0;

    return axes;
}

```

I just need a starting point.

Update:  
Found this discussion: [Ccall() to ioctl - #17 by yuyichao](https://discourse.julialang.org/t/ccall-to-ioctl/6219/17)

---

_[View the full topic](https://discourse.julialang.org/t/read-joystick-from-julia/81325)._
