Kodi Community Forum
v19 Keymap Editor (Kodi 18/19 and on) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: v19 Keymap Editor (Kodi 18/19 and on) (/showthread.php?tid=356730)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14


RE: Keymap Editor (Kodi 18/19 and on) - izprtxqkft - 2023-09-04

interesting

from that it looks like somehow it isn't triggering an onAction event to the keymap editor

might need to be expanded to also utilize EventClient as an event source - https://kodi.wiki/view/EventServer#Development_of_EventClients_and_the_EventServer_API

-----

on second thought it is a harmony remote which has been discontinued for some time now, unless others report issues i dont see a need to expand the code to work with it

recommend keeping your workaround


RE: Keymap Editor (Kodi 18/19 and on) - paul.j.ghosh - 2023-09-04

Well, something consistently causes the timer of 5 seconds to abort and return to the previous screen - so, something is getting through.


RE: Keymap Editor (Kodi 18/19 and on) - paul.j.ghosh - 2023-09-04

(2023-09-04, 22:54)jepsizofye Wrote: on second thought it is a harmony remote which has been discontinued for some time now, unless others report issues i dont see a need to expand the code to work with it

recommend keeping your workaround
It is actually a Philips Pronto TSU9400 that I programmed for XBMC decades ago.  https://www.usa.philips.com/c-p/TSU9400_37/pronto


RE: Keymap Editor (Kodi 18/19 and on) - paul.j.ghosh - 2023-09-05

I found the code... will try to troubleshoot and report back.


RE: Keymap Editor (Kodi 18/19 and on) - izprtxqkft - 2023-09-05

not exactly making a case by saying it is a different discontinued product


RE: Keymap Editor (Kodi 18/19 and on) - paul.j.ghosh - 2023-09-05

(2023-09-05, 02:18)jepsizofye Wrote: not exactly making a case by saying it is a different discontinued product
@jepsizofye - nice!!! love it...  anyways, I will try to figure out what is happening in the code.


RE: Keymap Editor (Kodi 18/19 and on) - paul.j.ghosh - 2023-09-10

(2023-09-04, 22:54)jepsizofye Wrote: interesting

from that it looks like somehow it isn't triggering an onAction event to the keymap editor

might need to be expanded to also utilize EventClient as an event source - https://kodi.wiki/view/EventServer#Development_of_EventClients_and_the_EventServer_API
onAction is being triggered but the code being returned is 0.
code = action.getButtonCode()


RE: Keymap Editor (Kodi 18/19 and on) - b1ggles - 2023-09-18

(2023-09-04, 22:54)jepsizofye Wrote: on second thought it is a harmony remote which has been discontinued for some time now, unless others report issues i dont see a need to expand the code to work with it

recommend keeping your workaround

You might not be able to buy a new one now but that doesn't mean there aren't thousands of us out there who will continue to use them until they literally fall apart.

Personally, I get around the issue by sending a command from the Harmony to Home Assistant, which then sends it on to the FireTV stick/cube.


RE: Keymap Editor (Kodi 18/19 and on) - izprtxqkft - 2023-09-18

(2023-09-18, 10:57)b1ggles Wrote:
(2023-09-04, 22:54)jepsizofye Wrote: on second thought it is a harmony remote which has been discontinued for some time now, unless others report issues i dont see a need to expand the code to work with it

recommend keeping your workaround

You might not be able to buy a new one now but that doesn't mean there aren't thousands of us out there who will continue to use them until they literally fall apart.

Personally, I get around the issue by sending a command from the Harmony to Home Assistant, which then sends it on to the FireTV stick/cube.

i own the harmony elite (with the hub), had it for years, replaced the battery a couple times but when the news came they were discontinuing it and i still didn't have features i was waiting for i reworked everything and eliminated it from my setup

now everything is automated, an adb logcat script, some scripts to operate my tp-link smart switches+bulbs+outlets some timers and some integrated voice controls i actually ended up with more control than i used to have with the harmony
(since i use tp-link and samsung smartthings which don't really like harmony)

everything is custom written though

-----

edit: i also use control modules from ewelink to "smartify" my "dumb" devices - similar to https://www.newegg.com/p/0YH-03G2-003W4


RE: Keymap Editor (Kodi 18/19 and on) - paul.j.ghosh - 2023-09-20

@pkscout
@jepsizofye

I think I have figured out the issue.  It probably affects all custom controllers.  The CAction object is not populated with wKeyID in file https://github.com/xbmc/xbmc/blob/20.2-Nexus/xbmc/input/InputManager.cpp#L233
The fix would involve a new constructor for CAction class that includes the argument for m_buttonCode in file https://github.com/xbmc/xbmc/blob/20.2-Nexus/xbmc/input/actions/Action.cpp and header.
Minimal change then to line 233 to include wKeyID as what will become m_buttonCode and then be available in python via action.getButtonCode() since it already works for keyboard input that follows a different path and construction of CAction object.

So, what can I do next to help?


RE: Keymap Editor (Kodi 18/19 and on) - pkscout - 2023-09-20

(2023-09-20, 01:42)paul.j.ghosh Wrote: @pkscout
@jepsizofye

I think I have figured out the issue.  It probably affects all custom controllers.  The CAction object is not populated with wKeyID in file https://github.com/xbmc/xbmc/blob/20.2-Nexus/xbmc/input/InputManager.cpp#L233
The fix would involve a new constructor for CAction class that includes the argument for m_buttonCode in file https://github.com/xbmc/xbmc/blob/20.2-Nexus/xbmc/input/actions/Action.cpp and header.
Minimal change then to line 233 to include wKeyID as what will become m_buttonCode and then be available in python via action.getButtonCode() since it already works for keyboard input that follows a different path and construction of CAction object.

So, what can I do next to help?
For changes to core Kodi, it's best to submit an issue at:

https://github.com/xbmc/xbmc

As it appears you have some programming background, you could also consider submitting a PR with the proposed changes.  But even the details you have in the issue would help.


RE: Keymap Editor (Kodi 18/19 and on) - paul.j.ghosh - 2023-09-20

(2023-09-20, 11:44)pkscout Wrote: ...you could also consider submitting a PR with the proposed changes...
PR done: 23789 (PR)
After a few failed builds on Jenkins CI and forced amend commits I was able to build and test locally.  Yes, it works!

The final change was similar in nature but instead of a new constructor the existing one was modified to take another parameter.  Since there are default values set it should not affect any other usages of the constructor.
Now I am waiting for a successful build on Jenkins and the merge of PR with backport to Nexus at least...

Here are snippets of logs showing not working and working:

2023-09-18 12:51:19.178 T:3131545   debug <general>: EventClient: button code 194 pressed
2023-09-18 12:51:19.178 T:3131545   debug <general>: EventClient: button code 194 released
2023-09-18 12:51:19.186 T:3131425   debug <general>: EventServer: key 194 translated to action ActivateWindow(Programs)
2023-09-18 12:51:19.187 T:3131425   debug <general>: Activating window ID: 10001
2023-09-18 12:51:19.187 T:5238372   debug <general>: action.getButtonCode(): 0

2023-09-20 11:34:16.696 T:5759207   debug <general>: EventClient: button code 194 pressed
2023-09-20 11:34:16.697 T:5759207   debug <general>: EventClient: button code 194 released
2023-09-20 11:34:16.725 T:5758980   debug <general>: EventServer: key 194 translated to action ActivateWindow(Programs)
2023-09-20 11:34:16.725 T:5758980   debug <general>: Activating window ID: 10001
2023-09-20 11:34:16.725 T:5759731   debug <general>: action.getButtonCode(): 194


RE: Keymap Editor (Kodi 18/19 and on) - paul.j.ghosh - 2023-09-21

@pkscout

Can you review and merge?  All tests have passed.
PR: 23789 (PR)


RE: Keymap Editor (Kodi 18/19 and on) - pkscout - 2023-09-22

(2023-09-21, 18:58)paul.j.ghosh Wrote: @pkscout

Can you review and merge?  All tests have passed.
PR: 23789 (PR)
I can't for changes to core (I only do Python stuff, so I only play in the add-on sandbox).  Someone else on the team will have to look at it.


RE: Keymap Editor (Kodi 18/19 and on) - paul.j.ghosh - 2023-10-01

In the Settings -> System -> Input -> Apple Remote section of Kodi the options are:

Disabled
Standard
Universal remote
Harmony remote

The files available in Kodi/system/keymaps are:

appcommand.xml
customcontroller.AppleRemote.xml
customcontroller.Harmony.xml
customcontroller.SiriRemote.xml
gamepad.xml
joystick.xml
keyboard.xml
mouse.xml
remote.xml
touchscreen.xml

I know selecting Harmony remote results in customcontroller.Harmony.xml being used.  What is used for Standard and Universal remote?