Game controller

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Game controller

Peter Easthope
Hi,

I'm interested in use of the game controller or controllers in
place of the TouchPad or mouse. This is relevant to eBook mode
where the TouchPad is not accessible and a mouse is not convenient.

This is what I have.
[olpc@xo-53-1d-bb ~]$ cat /boot/olpc_build
13.2.5 for XO-1.5 (build 17)

bash-4.2# evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: Lid Switch
/dev/input/event1: Power Button
/dev/input/event2: AT Translated Set 2 keyboard
/dev/input/event3: EBook Switch
/dev/input/event4: olpc-kbdshim virtual keyboard
/dev/input/event5: SynRelPS/2 Synaptics TouchPad
/dev/input/event6: olpc-kbdshim virtual mouse
/dev/input/event7: USB Optical Mouse
Select the device event number [0-7]:

No mention of the Game controller.  Is any joystick device present?

[olpc@xo-53-1d-bb ~]$ ls -l /dev/j*
ls: cannot access /dev/j*: No such file or directory

Can any Linux software detect or communicate with this game
controller?  Ideas?


_______________________________________________
Devel mailing list
[hidden email]
http://lists.laptop.org/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: Game controller

Paul Fox-2
the "game controller" is simply 4 separate electrical contacts with a
button large enough to push them individually or together (in some
combinations).  the resulting presses are reported as keyboard
keystrokes.  if i remember correctly, these buttons are bound to the
"keypad" versions of the arrow keys, i.e. KP_UP, KP_RIGHT, etc.  use
'xev' to check me on this.

paul

peter wrote:
 > Hi,
 >
 > I'm interested in use of the game controller or controllers in
 > place of the TouchPad or mouse. This is relevant to eBook mode
 > where the TouchPad is not accessible and a mouse is not convenient.
 >
 > This is what I have.
 > [olpc@xo-53-1d-bb ~]$ cat /boot/olpc_build
 > 13.2.5 for XO-1.5 (build 17)
 >
 > bash-4.2# evtest
 > No device specified, trying to scan all of /dev/input/event*
 > Available devices:
 > /dev/input/event0: Lid Switch
 > /dev/input/event1: Power Button
 > /dev/input/event2: AT Translated Set 2 keyboard
 > /dev/input/event3: EBook Switch
 > /dev/input/event4: olpc-kbdshim virtual keyboard
 > /dev/input/event5: SynRelPS/2 Synaptics TouchPad
 > /dev/input/event6: olpc-kbdshim virtual mouse
 > /dev/input/event7: USB Optical Mouse
 > Select the device event number [0-7]:
 >
 > No mention of the Game controller.  Is any joystick device present?
 >
 > [olpc@xo-53-1d-bb ~]$ ls -l /dev/j*
 > ls: cannot access /dev/j*: No such file or directory
 >
 > Can any Linux software detect or communicate with this game
 > controller?  Ideas?
 >
 >
 > _______________________________________________
 > Devel mailing list
 > [hidden email]
 > http://lists.laptop.org/listinfo/devel

=---------------------
 paul fox, [hidden email]
_______________________________________________
Devel mailing list
[hidden email]
http://lists.laptop.org/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: Game controller

Paul Fox-2
that being said, it's possible to write code to handle combinations
of those keypresses (e.g., "all mashed down at once") separately from
the individual strokes.  you either need to intercept the keys at a pretty
low level (scan codes) and keep track of the up and down state of every
key, or you can read the keys normally and use a user-level timer to decide
whether more than one has been pressed in very quick succession.

paul

i wrote:
 > the "game controller" is simply 4 separate electrical contacts with a
 > button large enough to push them individually or together (in some
 > combinations).  the resulting presses are reported as keyboard
 > keystrokes.  if i remember correctly, these buttons are bound to the
 > "keypad" versions of the arrow keys, i.e. KP_UP, KP_RIGHT, etc.  use
 > 'xev' to check me on this.
 >
 > paul
 >
 > peter wrote:
 >  > Hi,
 >  >
 >  > I'm interested in use of the game controller or controllers in
 >  > place of the TouchPad or mouse. This is relevant to eBook mode
 >  > where the TouchPad is not accessible and a mouse is not convenient.
 >  >
 >  > This is what I have.
 >  > [olpc@xo-53-1d-bb ~]$ cat /boot/olpc_build
 >  > 13.2.5 for XO-1.5 (build 17)
 >  >
 >  > bash-4.2# evtest
 >  > No device specified, trying to scan all of /dev/input/event*
 >  > Available devices:
 >  > /dev/input/event0: Lid Switch
 >  > /dev/input/event1: Power Button
 >  > /dev/input/event2: AT Translated Set 2 keyboard
 >  > /dev/input/event3: EBook Switch
 >  > /dev/input/event4: olpc-kbdshim virtual keyboard
 >  > /dev/input/event5: SynRelPS/2 Synaptics TouchPad
 >  > /dev/input/event6: olpc-kbdshim virtual mouse
 >  > /dev/input/event7: USB Optical Mouse
 >  > Select the device event number [0-7]:
 >  >
 >  > No mention of the Game controller.  Is any joystick device present?
 >  >
 >  > [olpc@xo-53-1d-bb ~]$ ls -l /dev/j*
 >  > ls: cannot access /dev/j*: No such file or directory
 >  >
 >  > Can any Linux software detect or communicate with this game
 >  > controller?  Ideas?
 >  >
 >  >
 >  > _______________________________________________
 >  > Devel mailing list
 >  > [hidden email]
 >  > http://lists.laptop.org/listinfo/devel
 >
 > =---------------------
 >  paul fox, [hidden email]
 > _______________________________________________
 > Devel mailing list
 > [hidden email]
 > http://lists.laptop.org/listinfo/devel

=---------------------
 paul fox, [hidden email]
_______________________________________________
Devel mailing list
[hidden email]
http://lists.laptop.org/listinfo/devel
Reply | Threaded
Open this post in threaded view
|

Re: Game controller

Peter Easthope
Paul,

On Sat, December 5, 2015 10:08 am, Paul Fox wrote:
> that being said, it's possible to write code to handle combinations of
> those keypresses (e.g., "all mashed down at once") separately from the
> individual strokes.  you either need to intercept the keys at a pretty low
> level (scan codes) and keep track of the up and down state of every key,
> or you can read the keys normally and use a user-level timer to decide
> whether more than one has been pressed in very quick succession.

Your replies are very helpful, thanks.  I imagine the left
and right controllers are the same or almost the same on
the circuit board; the difference is only in the buttons.
Will check next time I have the machine apart.

May I add your information to  http://wiki.laptop.org/go/Game_controller ?
It might interest others.

Thanks again,             ... Peter E.

--
Telephone 1 360 639 0202 or +13606390202.
Bcc: peter at easthope.ca  http://easthope.ca/Shop.html


_______________________________________________
Devel mailing list
[hidden email]
http://lists.laptop.org/listinfo/devel