Game controller

Paul Fox pgf at laptop.org
Sat Dec 5 11:08:57 EST 2015


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 at 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 at 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
 >  > Devel at lists.laptop.org
 >  > http://lists.laptop.org/listinfo/devel
 > 
 > =---------------------
 >  paul fox, pgf at laptop.org
 > _______________________________________________
 > Devel mailing list
 > Devel at lists.laptop.org
 > http://lists.laptop.org/listinfo/devel

=---------------------
 paul fox, pgf at laptop.org



More information about the Devel mailing list