Input.Action enter
#1
Hello,

I developed a IR HW and use JSON for controlling Kodi.
There is a Input.Action "enter" mentioned in the description, but it has no effect.
I thought it has the same effect as I press the "Enter" key on the keyboard.

Background:
The Enter-Key on the keyboard has 2 actions, "select" and "show OSD" depends on the
current situation.
I would like to have this also on one remote control button.

Thanks for help.

Rainer
Reply
#2
I used this to "click enter" on kodi: {"jsonrpc": "2.0", "id": 1, "method": "Input.Select"}
Reply
#3
I used this also for the selection, but it will not show the OSD in Video player mode.
For this I need a second command.
Reply
#4
Sorry, I misunderstood your post.
I guess you probably need to get first the list of active players (Player.GetActivePlayers) and depending on the list returned than use either Input.Select or Input.ShowOSD depending on the case.

You're probably suggesting a new feature or change on the current json api so I'll just shut up Smile

cheers
Reply
#5
Changing the API would be nice, but probably it will not happen.
The idea with getactivePlayers if good. I will try it.
Thanks.
Reply
#6
(2014-12-29, 22:54)YARD2 Wrote: I used this also for the selection, but it will not show the OSD in Video player mode.
For this I need a second command.
If you want the same effect as pressing a key (Enter) I think you are supposed to use the EventServer API. It respects the mapping done in the different keymaps.
I believe JSON-RPC is not meant to replace it.

jonib
XBMC2, EventGhost plugin. Image
Reply
#7
getactivePlayers does not work, since it also returns even if the User is in Main manu and the player running in the background.

I thought EventServer API is old and JSOn should be used ?
Reply
#8
(2014-12-30, 19:02)YARD2 Wrote: getactivePlayers does not work, since it also returns even if the User is in Main manu and the player running in the background.

I thought EventServer API is old and JSOn should be used ?

Makes sense.
Still assuming you want to achieve this through the json-api what about using:

PHP Code:
{"jsonrpc":"2.0","id":1,"method":"GUI.GetProperties","params":{"properties":["currentwindow"]}} 

Tried it with 2 different skins (confluence and nox) and the window id was always the same for videosd (12005). Might depend on the skin though:

Quote:{"id":1,"jsonrpc":"2.0","result":{"currentwindow":{"id":12005,"label":"Vídeo em ecrã cheio"}}}

And this doesn't happen when the video is playing in the background:

Quote:{"id":1,"jsonrpc":"2.0","result":{"currentwindow":{"id":10000,"label":"Início"}}}

note:Vídeo em ecrã cheio = fullscreenvideo ; Início = Homemenu
Reply
#9
Thank you yery much for the idea !
I think that could work !!!
Back to coding :-)
Reply
#10
Thanks for the help.
I can now manage the different events :-)
But I have one problem.
The Video and Live TV window has the same ID: 12005.
Is there an other way to detect that now is LiveTV playing ?
Reply
#11
I'm not a guru of json rpc api but the api has extensive documentation and it never hurted anyone just to try and see if it works and what it does return...

By getting the active players you can check the id of the current player being used:

Code:
{"jsonrpc": "2.0", "id": 1, "method": "Player.GetActivePlayers"}

This is the answer of the api:

Quote:{"id":1,"jsonrpc":"2.0","result":[{"playerid":1,"type":"video"}]}

Grab the playerId and call player.getitems:

Code:
{"jsonrpc":"2.0","id":1,"method":"Player.GetItem","params":{"playerid":1}}

It returns for a video (in this case some highlights):

Quote:{"id":1,"jsonrpc":"2.0","result":{"item":{"label":"2015.01.06 (20h00) - Juventus 1-1 Inter","type":"unknown"}}}

And for a PVR channel:

Quote:{"id":1,"jsonrpc":"2.0","result":{"item":{"id":9,"label":"Canal Q","type":"channel"}}}

type=channel is probably what you're looking to match.
Reply
#12
I found nothing in the API that looks like LiveTV.
I try with your hint.
Thanks.
Reply
#13
@YARD2, a way to check if the live tv is playing is to use the "XBMC.GetInfoBooleans" method with the "Pvr.IsPlayingTv" parameter, it will return true/false into the Pvr.IsPlayingTv returned value.
Reply
#14
Thank you for the hint!
Works fine :-)
Reply
#15
Hello 
new to the forum
I successfully installed Kodi on my Air ipad without jailbreaking. the problem I do not know how to go backwards to previous menu or page while using Kodi
Can someone help me please
Reply

Logout Mark Read Team Forum Stats Members Help
Input.Action enter0