Chill,

Would you mind testing this out for me.  My current jivelite setup is a
bit difficult to add encoders and buttons to......but I did verify that
I'm getting keyboard events.

https://dl.dropboxusercontent.com/s/os6duhpkskgzj4c/sbpd

This is the latest source using pigpio, so make sure you have that
library setup.
We are using the kernel uinput module, so you need to load it, then set
the permission to group writable, so you don't need to run sbpd with
root permissions.

Code:
--------------------
    
  sudo modprobe uinput
  sudo chmod g+w /dev/uinput
  
--------------------


Here is the help info......linux key names are found 
https://github.com/raspberrypi/linux/blob/rpi-4.19.y/include/uapi/linux/input-event-codes.h

Code:
--------------------
    
  For rotary encoders (one, volume only):
  e,pin1,pin2,CMD[,edge]
  "e" for "Encoder"
  p1, p2: GPIO PIN numbers in BCM-notation
  CMD: Command. one of. \n\
  VOLU for Volume\n\
  TRAC for Prev/Next track\n\
  KEY:<Positive key_name>-<Negative key_name>
  mode: Optional. one of\n\
  1   - Step mode (default)\n\
  2-9 - Detent mode - Assumes 1 dial click is x steps.
  
  For buttons: 
  b,pin,CMD[,resist,pressed,CMD_LONG,long_time]
  "b" for "Button"
  pin: GPIO PIN numbers in BCM-notation
  CMD: Command. One of:
  PLAY:   Play/pause
  PREV:   Jump to previous track
  NEXT:   Jump to next track
  VOL+:   Increase volume
  VOL-:   Decrease volume
  POWR:   Toggle power state
  Commands can be defined in config file
  use -f option, ref:sbpd_commands.cfg 
  Command type SCRIPT.
  SCRIPT:/path/to/shell/script.sh
  Command type KEY.
  KEY:<linux key_name>.
  resist: Optional. one of
  0 - Internal resistor off
  1 - pull down         - input puts 3v on GPIO pin
  2 - pull up (default) - input pulls GPIO pin to ground
  pressed: Optional GPIO pinstate for button to read pressed
  0 - state is 0 (default)
  1 - state is 1
  CMD_LONG: Command to be used for a long button push, see above command list
  long_time: Number of milliseconds to define a long press
  
--------------------


For example

Code:
--------------------
    
  ./sbpd -v e,20,21,KEY:KEY_UP-KEY_DOWN,4  
b,20,KEY:KEY_RIGHT,2,0,KEY:KEY_LEFT,500
  
--------------------



piCorePlayer a small player for the Raspberry Pi in RAM. 
Homepage: https://www.picoreplayer.org

Please 'donate'
(https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=U7JHY5WYHCNRU&lc=GB&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)
if you like the piCorePlayer
------------------------------------------------------------------------
paul-'s Profile: http://forums.slimdevices.com/member.php?userid=58858
View this thread: http://forums.slimdevices.com/showthread.php?t=107001

_______________________________________________
diy mailing list
diy@lists.slimdevices.com
http://lists.slimdevices.com/mailman/listinfo/diy

Reply via email to