PDA

View Full Version : How to get Jivelite to understand new keys?



r.ludwig
2018-12-30, 04:39
Hello,

I have been using picoreplayer a while now successfully and want to extend one of the players with a bluetooth remote control. I have one which has exactly media control 5 buttons. Perfect for a media player :)

So what I did was to add a small pico bluetooth receiver to the Raspberry Pi and connecting the remote using the standard bluetooth commands. It all works like charm and I can also add the bluetooth directory structure to the backup so that they last a reboot.

Important to know is that I still want the solution to be headless (no screen) but I understood that using jivelite should still be a simple solution to get a remote added in picoreplayer.

When I use "evtest" to log the commands received I get these events (the one's in parentheses are when holding the button):


KEY_VOLUMEUP

KEY_NEXTSONG KEY_PLAYPAUSE KEY_PREVIOUSSONG
(KEY_MENU) (KEY_HOMEPAGE) (KEY_POWER)

KEY_VOLUMEDOWN

So I now copied the InputToActionMap.lua to /home/tc/.jivelite/userpath/jive and can now see it get used instead.

Though when I add the new keys above:

keyActionMappings.press = {
[KEY_HOME] = "go_home_or_now_playing",
[KEY_PLAY] = "play",
[KEY_ADD] = "add",
[KEY_PREVIOUSSONG] = "back",

I get an error in the log:

Jive: ...home/tc/.jivelite/userpath/jive/InputToActionMap.lua:103: table index is nil
stack traceback:
...home/tc/.jivelite/userpath/jive/InputToActionMap.lua:103: in main chunk
[C]: in function 'require'
/opt/jivelite/share/jive/jive/JiveMain.lua:47: in main chunk

This points to that KEY_PREVIOUSSONG isn't defined. (which is in line 103)

What is the right way to get these new keys accessible?

Any clue on this?

Cheers

Richard

r.ludwig
2019-01-06, 08:50
Hello,

is there any forum available for jivelite? Or do I need to post this question somewhere else?

Thanks

Richard

ralphy
2019-01-07, 05:57
You need to recompile jivelite after adding a new key definition to jive_framework.c and jive.h. You also need to update InputToActionMap.lua and JiveMain.lua with the new key map.

Also depending the the key you're trying to use, the SDL library may need to be modified for either the fbcon and/or X11 event handlers.

r.ludwig
2019-01-07, 10:15
You need to recompile jivelite after adding a new key definition to jive_framework.c and jive.h. You also need to update InputToActionMap.lua and JiveMain.lua with the new key map.

Also depending the the key you're trying to use, the SDL library may need to be modified for either the fbcon and/or X11 event handlers.

Thanks, will have a try!