Gambas -> USB -> DragonRise USB Joystick -> Use
Posted
#1
(In Topic #1145)
Regular

I would like to use it with the Raspberry Pi and possibly with a laptop to provide joystick input and/or 12 button inputs for different uses.
When plugged into the USB port it can be found via terminal…
Code
~$ less /proc/bus/input/devicesIt will return something like
Code
I: Bus=0003 Vendor=0079 Product=0006 Version=0110
N: Name="DragonRise Inc. Generic USB Joystick "
P: Phys=usb-0000:00:1a.0-1.4/input0
S: Sysfs=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/0003:0079:0006.0005/input/input23
U: Uniq=
H: Handlers=event19 js0
B: PROP=0
B: EV=20001b
B: KEY=fff00000000 0 0 0 0
B: ABS=3002f
B: MSC=10
B: FF=107030000 0
My question is… how do I read this so that I can use the inputs for something?
This method should work for other joysticks too… just the name would change.
With all the people building games… I'm sure someone figured it out already.
Thanks,
Jerry
Posted
Regular

b
Posted
Regular

Is "/dev/input/js0" file-device present ?
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Guru

:roll:
there has been talk about joysticks on other more relevant forum topics but the IDE does not have any joystick features.
Posted
Regular

Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Guru

vuott said
:? A loophole is always possible.
Haha , yep that's true
Posted
Regular

Wait… I just found this… Gambas One - Gambas ONE
I'm going to download that and see if I can figure it out.
Jerry
Posted
Regular

Jerry,Askjerry said
Wait… I just found this… Gambas One - Gambas ONE
I'm going to download that and see if I can figure it out.
Joystick.Class, of that code you found, handles exactly the file-device that I had asked you to look at:
Gambas One - Gambas ONE
However, you need to check in the folder, which contains it, whether it is a protected file-device (as is likely).
If so, you will have to remove the protection with a few lines similar to these:
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
1 guest and 0 members have just viewed this.


