See 'this post'
(https://forums.slimdevices.com/showthread.php?103330-Jivelite-for-piCorePlayer/page98)
for details on downloading the evtest tool.

Here's the output from a Logitech controller.


Code:
--------------------
    
  tc@rpi27:/mnt/mmcblk0p2/tce$ ./evtest
  No device specified, trying to scan all of /dev/input/event*
  Not running as root, no devices may be available.
  Available devices:
  /dev/input/event0:    FT5406 memory based driver
  /dev/input/event1:    Logitech Logitech Dual Action
  Select the device event number [0-1]: 1
  Input driver version is 1.0.1
  Input device ID: bus 0x3 vendor 0x46d product 0xc216 version 0x111
  Input device name: "Logitech Logitech Dual Action"
  Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
  Event code 288 (BTN_TRIGGER)
  Event code 289 (BTN_THUMB)
  Event code 290 (BTN_THUMB2)
  Event code 291 (BTN_TOP)
  Event code 292 (BTN_TOP2)
  Event code 293 (BTN_PINKIE)
  Event code 294 (BTN_BASE)
  Event code 295 (BTN_BASE2)
  Event code 296 (BTN_BASE3)
  Event code 297 (BTN_BASE4)
  Event code 298 (BTN_BASE5)
  Event code 299 (BTN_BASE6)
  Event type 3 (EV_ABS)
  Event code 0 (ABS_X)
  Value    127
  Min        0
  Max      255
  Flat      15
  Event code 1 (ABS_Y)
  Value    127
  Min        0
  Max      255
  Flat      15
  Event code 2 (ABS_Z)
  Value    128
  Min        0
  Max      255
  Flat      15
  Event code 5 (ABS_RZ)
  Value    127
  Min        0
  Max      255
  Flat      15
  Event code 16 (ABS_HAT0X)
  Value      0
  Min       -1
  Max        1
  Event code 17 (ABS_HAT0Y)
  Value      0
  Min       -1
  Max        1
  Event type 4 (EV_MSC)
  Event code 4 (MSC_SCAN)
--------------------


You should be able to remap the EV_KEY event type 1 keys using the
information from 'this post'
(https://forums.slimdevices.com/showthread.php?110640-Howto-create-a-linux-kernel-IR-remote-keytable-for-Jivelite-on-piCorePlayer-5&p=983675&viewfull=1#post983675).

Note that the post is for squeezelite, if you want to control jivelite
you must not disable lirc as described at the top, start at the 'Plug in
your FLIRC and find the name.' 
You need to have lirc installed and enabled for jivelite to work with
the joystick

Make sure the evdev module is loaded


Code:
--------------------
    tc@rpi27:~$ sudo modprobe evdev
--------------------


Find the joystick device name

Code:
--------------------
    tc@rpi27:/mnt/mmcblk0p2/tce$ cat /proc/bus/input/devices
  
  I: Bus=0003 Vendor=046d Product=c216 Version=0111
  N: Name="Logitech Logitech Dual Action"
  P: Phys=usb-3f980000.usb-1.4/input0
  S: 
Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:046D:C216.0001/input/input2
  U: Uniq=F7FA2D56
  H: Handlers=event1 js0 
  B: PROP=0
  B: EV=1b
  B: KEY=fff 0 0 0 0 0 0 0 0 0
  B: ABS=30027
  B: MSC=10
  
--------------------


Run inputlircd as the tc user in an ssh session.

sudo /usr/local/sbin/inputlircd -n "Logitech Logitech Dual Action" -m 0
-g -r 500 -f

And in another ssh connect run irw which returns.
tc@rpi27:~$ irw

Code:
--------------------
    120 0 BTN_JOYSTICK /dev/input/event1
  121 0 BTN_THUMB /dev/input/event1
  123 0 BTN_TOP /dev/input/event1
  122 0 BTN_THUMB2 /dev/input/event1
--------------------


You can map the keys to 'jivelite action'
(https://github.com/ralph-irving/tcz-lirc/blob/master/jivekeys.csv) by
creating a keymap file for inputlircd.

For example:

Code:
--------------------
    $ cat /home/tc/inputlircd.keymap
  BTN_TOP = KEY_UP
  BTN_THUMB = KEY_DOWN
  BTN_JOYSTICK = KEY_LEFT
  BTN_THUMB2 = KEY_RIGHT
--------------------


Press ctrl-c in the inputlircd session and restart it using
sudo /usr/local/sbin/inputlircd -n "Logitech Logitech Dual Action" -m 0
-g -r 500 -t /home/tc/inputlircd.keymap -f

Press ctrl-c in the irw session and restart irw and you should get the
remapped keys.


Code:
--------------------
    tc@rpi27:~$ irw
  121 0 KEY_DOWN /dev/input/event1
  123 0 KEY_UP /dev/input/event1
  122 0 KEY_RIGHT /dev/input/event1
  120 0 KEY_LEFT /dev/input/event1
--------------------



Ralphy

*1*-Touch, *5*-Classics, *3*-Booms, *2*-UE Radio
'Squeezebox client builds'
(https://sourceforge.net/projects/lmsclients/files/) 'donations'
(https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=LL5P6365KQEXN&lc=CA&item_name=Squeezebox%20client%20builds&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)
always appreciated.
------------------------------------------------------------------------
ralphy's Profile: http://forums.slimdevices.com/member.php?userid=3484
View this thread: http://forums.slimdevices.com/showthread.php?t=116236

_______________________________________________
diy mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/diy

Reply via email to