[Gambas-user] gb.joystick (and Where is my gbh3?)

Tobias Boege taboege at gmail.com
Sun Feb 24 23:02:33 CET 2019


Hi all,

I have just pushed two commits to the gb.joystick branch. This is
work that has been on my hard disk(s) since 2015, with a few bits
from Cedron Dawg mixed in.

The component makes Linux' legacy Joystick API available to Gambas
without bells and whistles. You create a joystick by opening the
appropriate device /dev/input/jsX and then you receive Button or
Axis events when someone touches the thing. [ There is a newer
evdev API but the legacy one is nice too. ]

Attached is a fairly minimal toy program. Please test it if you
have the hardware.

One thing: The first commit on that branch had a concept of a
"stick" on your joystick which has two axes associated with it.
That's usually what you imagine a joystick/gamepad to have.
The second commit removes these notions because I realized that
sticks with only one axis exist. Maybe that's the reason why
the underlying Linux API refers to axes individually. And while
axes do seem to come in pairs on my gamepad, they do not always
come in the same order: sometimes the horizontal axis is index 0,
sometimes it is index 1. So, I decided to remove that logic and
leave the mapping of axes to the user. Tell me what you think.

One more thing: the component is basically fully documented in its
source code. How does that documentation go into the wiki again?
Has it been automated yet? BTW, I've seen that the entire source
code of gbh3 was wiped out by commit 5bb2f41b21b72:

  Remove '*.mo' files now automatically generated by the compiler,
  and other filed that should be ignored too.

Surely that was by mistake? (I remember someone reporting spurious
"gbh3 could not be compiled" errors. That's the reason why.)

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190224/48a9da81/attachment.sig>


More information about the User mailing list