I have a Panasonic TV and remote.
I have been trying to get a keymap to work and have spent too much time on it banging my head against the wall.
What I am trying to achieve is when the “AV” button is pressed I want OSMC to either stay on the screen it is on, or go to the Main Menu screen.
The code for the AV button is 249. Here is my last attempt
cat .kodi/userdata/keymaps/gen.xml
<keymap><global><keyboard><key id="169">left</key><key id="168">right</key><key id="166">up</key><key id="167">down</key><key id="11">select</key><key id="216">back</key><key id="249">ActivateWindow(startwindow)</key></keyboard></global></keymap>
<Home>
<keyboard>
<key><key id="249">ActivateWindow(home)</key>
</keyboard>
</Home>
I have been using the Keymap Editor addon to generate this keymap, and when that provided a keymap that didn’t do what I wanted, I added the bits. It still didn’t work.
Here is the log for my last attempt
2021-08-22 11:09:40.649 T:461 DEBUG <general>: PushCecKeypress - received key f9 duration 0
2021-08-22 11:09:40.659 T:398 DEBUG <general>: HandleKey: 249 (0xf9, obc6) pressed, action is activatewindow(home)
2021-08-22 11:09:40.659 T:398 DEBUG <general>: Activating window ID: 10000
2021-08-22 11:09:40.915 T:398 DEBUG <general>: ------ Window Deinit (Settings.xml) ------
2021-08-22 11:09:40.915 T:398 DEBUG <general>: FreeVisualisation() done
2021-08-22 11:09:40.958 T:398 DEBUG <general>: ------ Window Init (Home.xml) ------
2021-08-22 11:09:40.978 T:398 DEBUG <general>: [Warning] CGUITextureManager::GetTexturePath: could not find texture 'noop'
2021-08-22 11:09:40.995 T:17848 DEBUG <general>: Thread LanguageInvoker start, auto delete: false
2021-08-22 11:09:40.995 T:17848 INFO <general>: initializing python engine.
2021-08-22 11:09:40.996 T:17848 DEBUG <general>: CPythonInvoker(144, /home/osmc/.kodi/addons/script.skinshortcuts/default.py): start processing
2021-08-22 11:09:40.996 T:17849 DEBUG <general>: Thread Timer start, auto delete: false
2021-08-22 11:09:41.267 T:17848 DEBUG <general>: -->Python Interpreter Initialized<--
2021-08-22 11:09:41.267 T:17848 DEBUG <general>:
2021-08-22 11:09:41.267 T:17848 DEBUG <general>: CPythonInvoker(144, /home/osmc/.kodi/addons/script.skinshortcuts/default.py): the source file to load is "/home/osmc/.kodi/addons/script.skinshortcuts/default.py"
2021-08-22 11:09:41.267 T:17848 DEBUG <general>: CPythonInvoker(144, /home/osmc/.kodi/addons/script.skinshortcuts/default.py): setting the Python path to /home/osmc/.kodi/addons/script.skinshortcuts:/home/osmc/.kodi/addons/script.module.simpleeval/lib:/home/osmc/.kodi/addons/script.module.unidecode/lib:/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages
2021-08-22 11:09:41.268 T:17848 DEBUG <general>: CPythonInvoker(144, /home/osmc/.kodi/addons/script.skinshortcuts/default.py): entering source directory /home/osmc/.kodi/addons/script.skinshortcuts
2021-08-22 11:09:41.268 T:17848 DEBUG <general>: CPythonInvoker(144, /home/osmc/.kodi/addons/script.skinshortcuts/default.py): instantiating addon using automatically obtained id of "script.skinshortcuts" dependent on version 3.0.0 of the xbmc.python api
2021-08-22 11:09:41.500 T:17849 DEBUG <general>: Thread Timer 1391456448 terminating
2021-08-22 11:09:43.583 T:17848 DEBUG <CAddonSettings[script.skinshortcuts]>: trying to load setting definitions from old format...
2021-08-22 11:09:43.592 T:17850 DEBUG <general>: Thread Timer start, auto delete: false
2021-08-22 11:09:43.592 T:17848 INFO <general>: CPythonInvoker(144, /home/osmc/.kodi/addons/script.skinshortcuts/default.py): script successfully run
2021-08-22 11:09:43.592 T:17848 DEBUG <general>: onExecutionDone(144, /home/osmc/.kodi/addons/script.skinshortcuts/default.py)
2021-08-22 11:09:43.619 T:17850 DEBUG <general>: Thread Timer 1391456448 terminating
2021-08-22 11:09:43.619 T:17851 DEBUG <general>: Thread Timer start, auto delete: false
2021-08-22 11:09:43.645 T:17851 DEBUG <general>: Thread Timer 1391456448 terminating
2021-08-22 11:09:43.646 T:17852 DEBUG <general>: Thread Timer start, auto delete: false
2021-08-22 11:09:44.150 T:17852 DEBUG <general>: Thread Timer 1391456448 terminating
2021-08-22 11:09:44.339 T:17848 INFO <general>: Python interpreter stopped
2021-08-22 11:09:44.339 T:17848 DEBUG <general>: Thread LanguageInvoker 1136652480 terminating
2021-08-22 11:09:48.179 T:461 DEBUG <general>: PushCecKeypress - received key a6 duration 0
2021-08-22 11:09:48.206 T:398 DEBUG <general>: HandleKey: 166 (0xa6, obc89) pressed, action is up
2021-08-22 11:09:48.274 T:461 DEBUG <general>: PushCecKeypress - received key a6 duration 94
2021-08-22 11:09:48.819 T:461 DEBUG <general>: PushCecKeypress - received key a6 duration 0
2021-08-22 11:09:48.842 T:398 DEBUG <general>: HandleKey: 166 (0xa6, obc89) pressed, action is up
2021-08-22 11:09:48.915 T:461 DEBUG <general>: PushCecKeypress - received key a6 duration 95
2021-08-22 11:09:49.159 T:461 DEBUG <general>: PushCecKeypress - received key a6 duration 0
2021-08-22 11:09:49.175 T:398 DEBUG <general>: HandleKey: 166 (0xa6, obc89) pressed, action is up
2021-08-22 11:09:49.255 T:461 DEBUG <general>: PushCecKeypress - received key a6 duration 96
2021-08-22 11:09:49.498 T:461 DEBUG <general>: PushCecKeypress - received key a6 duration 0
2021-08-22 11:09:49.508 T:398 DEBUG <general>: HandleKey: 166 (0xa6, obc89) pressed, action is up
2021-08-22 11:09:49.595 T:461 DEBUG <general>: PushCecKeypress - received key a6 duration 96
2021-08-22 11:09:49.879 T:461 DEBUG <general>: PushCecKeypress - received key a6 duration 0
2021-08-22 11:09:49.908 T:398 DEBUG <general>: HandleKey: 166 (0xa6, obc89) pressed, action is up
2021-08-22 11:09:49.974 T:461 DEBUG <general>: PushCecKeypress - received key a6 duration 95
2021-08-22 11:09:50.408 T:461 DEBUG <general>: PushCecKeypress - received key a6 duration 0
2021-08-22 11:09:50.458 T:398 DEBUG <general>: HandleKey: 166 (0xa6, obc89) pressed, action is up
2021-08-22 11:09:50.504 T:461 DEBUG <general>: PushCecKeypress - received key a6 duration 96
2021-08-22 11:09:52.608 T:461 DEBUG <general>: PushCecKeypress - received key a8 duration 0
2021-08-22 11:09:52.611 T:398 DEBUG <general>: HandleKey: 168 (0xa8, obc87) pressed, action is right
2021-08-22 11:09:52.704 T:461 DEBUG <general>: PushCecKeypress - received key a8 duration 96
2021-08-22 11:09:54.571 T:461 DEBUG <general>: PushCecKeypress - received key f9 duration 0
2021-08-22 11:09:54.604 T:398 DEBUG <general>: HandleKey: 249 (0xf9, obc6) pressed, action is ActivateWindow(Weather)
2021-08-22 11:09:54.604 T:398 DEBUG <general>: Activating window ID: 12600
2021-08-22 11:09:54.839 T:398 DEBUG <general>: ------ Window Deinit (Home.xml) ------
2021-08-22 11:09:54.840 T:398 DEBUG <general>: FreeVisualisation() done
2021-08-22 11:09:54.875 T:398 DEBUG <general>: ------ Window Init (MyWeather.xml) ------
2021-08-22 11:09:54.875 T:398 DEBUG <general>: [Warning] CGUITextureManager::GetTexturePath: could not find texture 'noop'
2021-08-22 11:09:54.912 T:17854 DEBUG <general>: Thread JobWorker start, auto delete: true
2021-08-22 11:09:54.913 T:17854 ERROR <general>: DoWork - Direct texture file loading failed for resource://resource.images.weathericons.default/.png
2021-08-22 11:09:54.913 T:17854 DEBUG <general>: GetImageHash - unable to stat url resource://resource.images.weathericons.default/.png
2021-08-22 11:10:02.929 T:461 DEBUG <general>: PushCecKeypress - received key d8 duration 0
2021-08-22 11:10:02.958 T:398 DEBUG <general>: HandleKey: menu (0xd8) pressed, action is PreviousMenu
2021-08-22 11:10:02.958 T:398 DEBUG <general>: CGUIWindowManager::PreviousWindow: Deactivate
2021-08-22 11:10:03.145 T:461 DEBUG <general>: PushCecKeypress - received key d8 duration 217
2021-08-22 11:10:03.164 T:398 DEBUG <general>: ------ Window Deinit (MyWeather.xml) ------
2021-08-22 11:10:03.165 T:398 DEBUG <general>: FreeVisualisation() done
2021-08-22 11:10:03.208 T:398 DEBUG <general>: CGUIWindowManager::PreviousWindow: Activate new
2021-08-22 11:10:03.208 T:398 DEBUG <general>: ------ Window Init (Home.xml) ------
2021-08-22 11:10:03.228 T:398 DEBUG <general>: [Warning] CGUITextureManager::GetTexturePath: could not find texture 'noop'
2021-08-22 11:10:03.246 T:17855 DEBUG <general>: Thread LanguageInvoker start, auto delete: false
2021-08-22 11:10:03.246 T:17855 INFO <general>: initializing python engine.
2021-08-22 11:10:03.246 T:17855 DEBUG <general>: CPythonInvoker(145, /home/osmc/.kodi/addons/script.skinshortcuts/default.py): start processing
2021-08-22 11:10:03.247 T:17856 DEBUG <general>: Thread Timer start, auto delete: false
2021-08-22 11:10:03.517 T:17855 DEBUG <general>: -->Python Interpreter Initialized<--
2021-0
As you can see the initial press of AV resulted in
2021-08-22 11:09:40.659 T:398 DEBUG <general>: HandleKey: 249 (0xf9, obc6) pressed, action is activatewindow(home)
But the next press gave me
2021-08-22 11:09:54.604 T:398 DEBUG <general>: HandleKey: 249 (0xf9, obc6) pressed, action is ActivateWindow(Weather)
Can any help me solve this issue. I am obviously missing something.