MP 1.23 Key Mapping (1 Viewer)

macmr

Portal Pro
August 21, 2011
105
17
Home Country
I recently upgraded from MP 1.14 to MP 1.23. In 1.14 I was using the InputPlugIn to map my remote keys and all was working fine. In 1.23 I thought I would use the built in HID handler instead of the InputPlugIn. I have the Enable HID & Use HID keyboard options selected. I tried the original HID "full" map option and as expected my remote would not work correctly as I knew I would have to remap. What was working was the keyboard "escape" key which worked as per the mapping in closing windows / dialogs successfully.

My remote uses the "back" keycode so easy fix for my remote to get that part working all I had to do was change the HID keymap from "escape" to "back" and leave all the actions etc under it the same. Ah no that only partially worked as it would not close the dialogs that come up when you press the record key or the Mini Guide but all else was working ok. But the back button on the topbar closes them successfully.

Mmm why? So next step was to change via an xml editor the "esc" option in the keymap.xml (yes the old original one that still sits in the ProgramData/Team/MediaPortal/MediaPortal) to "backspace" (yes "backspace" not "back"). This option has the action as "Previous menu". Now success using the remote as it closed the windows that couldn't be closed previously.

Further testing by eliminating both the "esc" & "backspace" keys from keymap.xml while having them both in the hid "full" map produced the same result of not being able to close those two dialogs even though the rest of the actions performed perfectly. And yes the HID "full" map had the "No condition" option set to "Previous menu" on those two keys.

So it seems to me as though the old keymap.xml is at least influencing the closing of the two previously mentioned dialogs?

I now have the keymap.xml set with a "backspace" key where the "esc" option was and all is working great for me.

I suspect that most people won't notice any problem because if their remote uses the "esc" code then all would work as expected

Not sure if what I wrote is easy to follow but any feedback is appreciated. I will wait before I log it as a bug. Thanks.
 
Last edited:

CyberSimian

Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    There are basically two types of remote:

    (1) Those that are "MCE compatible" and which use the RC6 signalling protocol.
    (2) Those that are "MCE compatible" but which do not use the RC6 signalling protocol.

    Remotes of type (1) are bog-standard MCE remotes that use the "Microsoft eHome Infrared Transceiver" driver in Windows "Device Manager".

    Remotes of type (2) appear as keyboard devices, and so use the standard Windows keyboard device driver. The catch here is that these remotes send WMC keyboard shortcuts, some of which are different from MP keyboard shortcuts. So a type (2) remote works only partially with MP. You need to use some additional software in order for the remote to work fully with MP.

    One popular remote of type (2) is the Ortek VRC-1100 (also known as the Hama 00052451). This is the remote that I use, although I believe that it has recently been discontinued. To use this remote, it is necessary to use the "Centarea HID" on the "Sceneo" tab in the "Remotes" section of "MP Config", and not the "HID" tab. There is a support pack available that contains a working config file for this remote.

    You have not specified which remote you are using, but if it is one that sends WMC keyboard shortcuts, it might be worth trying the "Centarea HID" with the support pack. I have often wondered whether the "Centarea HID" support is tied to the Ortek/Hama remote, or whether it would work with any remote sending WMC keyboard shortcuts. I cannot verify this as the Ortek/Hama is the only remote I have that sends WMC keyboard shortcuts. :(

    -- from CyberSimian in the UK
     

    macmr

    Portal Pro
    August 21, 2011
    105
    17
    Home Country
    Hi thanks for the info about the remotes but I really don't think that the problem is with the remote. I think it is more to do with the HID handler. The reason I say that is because the problem can be simulated by the keyboard with no remote use whatsoever. Maybe this is in the wrong forum?

    Some more info:
    My remote uses standard key codes like "esc" etc as verified by a program to show what keycodes are being sent. Also in device manager the remote shows up as a HID Keyboard Device so I'm certain that to MP it is just another keyboard but using a remote to generate the keycodes.

    But let's forget I have a remote and concentrate on the behaviour from direct control via a keyboard.

    Maybe Cybersimian as you are from the Test Group you could carry out the following:

    My testing today went like this for MP 1.23 and using PureVisionHD as the skin:
    1. In the HID tab select "full" profile - Enable HID - Use HID keyboard. So we are using the standard mapping as comes with MP 1.23
    2. Plug in a keyboard
    3. Run MP
    4. Start watching fullscreen tv and press the "r" key which should bring up the dialog regarding the type of recording you want to do
    5. Hit the "esc" key and it should remove that recording window
    6. While watching fullscreen tv hit "esc" and it should go back to a previous menu of some description
    6. So far all good and working correctly as you would expect

    Now for the file mod

    1. Go into keymap.xml (the original one that still sits in the ProgramData/TeamMediaPortal/MediaPortal) with an xml editor (you can't do it from inside MP config)
    2. Remove the "esc" key action
    3. Run MP
    4. Start watching fullscreen tv and press the "r" key which should bring up the dialog regarding the type of recording you want to do
    5. Hit the "esc" key. On my system this did not remove the recording window like it did prior to the keymap.xml file edit
    6. While watching fullscreen tv hit "esc" and it should go back to a previous menu of some description

    Hopefully the above steps did what mine does. So no remote use only the keyboard so that rules out any remote issues.

    My questions:
    1. After editing the keymap.xml file and removing the "esc" action how can you back out of tv fullscreen if the "esc" key is not there anymore? I believe it is still using the HID "full" map option to accomplish this function.
    BUT
    2. Without the "esc" action in keymap.xml the dialog regarding the type of recording info cannot be removed from the screen? This was also the case in the Mini EPG.

    So some of the functions in MP are being controlled by HID "full" map and some by keymap.xml. Why?

    I thought that having the HID option to select and being able to remap as needed was nullifying the keymap.xml file. Especially after the old keys section says to use the new HID section?
     
    Last edited:

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    Maybe Cybersimian as you are from the Test Group
    Yes, I am in the test group, but I don't understand how the code works, or indeed how it is supposed to work. o_O

    Sadly, in recent years there has been a steady decline in the number of active MP1 developers, and the particular developer who introduced the new HID support is no longer active :(. You may well have found a bug or inconsistency in the HID handling, but I regret to say that in my estimation it won't be fixed. :cry:

    So some of the functions in MP are being controlled by HID "full" map and some by keymap.xml. Why?
    I cannot answer this question as I have no idea whether "keymap.xml" is completely obsolete, or whether it is still used in some cases. :confused:

    When MP users describe their problems, I usually try to suggest a workaround that as far as possible satisfies their requirements. From the description of your remote, you should probably try the "Centarea HID" support pack that I linked in my previous post. It may work for you.

    If you don't want to try the "Centarea HID", then the only other workarounds that occur to me are:
    (1) Purchase a proper MCE RC6 remote and receiver.
    (2) Stay with MP 1.14 and don't upgrade to MP 1.23.

    I am sorry if this seems like a brush off, but there are vast amounts of MP code that no one knows anything about, and sadly the HID handling is now in that category. :(

    -- from CyberSimian in the UK
     

    macmr

    Portal Pro
    August 21, 2011
    105
    17
    Home Country

    And what does this mean?

    Anyway getting back to CyberSimian's thoughtfull and concise response.

    No I don't think that you are giving me the brush off. Far from it I respect your honesty in explaining the problems with the lack of developers especially some of the original guys who made MP what it is today. I do realise that it is very difficult to take over someone elses coding and be able to make sense of their thought patterns. As you say this may be a bug but from the sound of it it will never get fixed.

    Is it still worth logging a bug report or is it in the too hard basket?

    As mentioned in an earlier post this problem affects the HID handler of at least MP 1.23 and probably some recent versions. Some people may never even have a problem depending on what HID codes their remotes are using.

    Ok my final and cleanest fix (I hope) for anyone that may have the same problems as I had.

    I am now running the original key map files as delivered in the MP 1.23 package. I have not enabled any of the options in the Remotes & Input Devices section in Mediaportal Configuration setup. I copied my MP 1.14 KeyboardInputPlugin.dll file into the Program Files\Team MediaPortal\MediaPortal\plugins\process directory and the keyboard.xml file (the mapping file for the plugin) into ProgramData\Team MediaPortal\MediaPortal\InputDeviceMappings. This now makes the plugin show up in the plugins section of the Configuration setup and allows key remapping.

    This copying was necessary because the KeyboardInputPlugin is no longer available even though it shows as being downloadable in the extensions manager?

    I realise that as this plugin is no longer available it won't help anyone that can't get it from somewhere but that is my fix none the less.
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,369
    Kyiv
    Home Country
    Ukraine Ukraine
    And what does this mean?
    I called a person who can help.
    Ok my final and cleanest fix (I hope) for anyone that may have the same problems as I had.
    Look: HID Known Issues and try test you remote - HID Demo
    Remove the "esc" key action
    What for? It may be easier to assign the same action ([ESC]) to backspace?
    I realise that as this plugin is no longer available it won't help anyone that can't get it from somewhere but that is my fix none the less.
    In order to help, you need to understand what is going on. What a remote control. What are the click codes. Settings, etc. At the top, I brought a program that shows the click code. In mapping, you can assign the same action to pressing backspace that is performed when you press the ESC.

    PS: I use the HID steering wheel, use the CEC remote control, use the keyboard, and all this with completely standard settings. If necessary, I can provide them.

    Documentation - HID Keyboard support and HID
    Similar problem - Remote has stopped working in "Pop-up" Menus
    Keyboard support - [Finished] - [MP1-4795] Add keyboard support to HID handler
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,849
    1,771
    Southampton
    Home Country
    United Kingdom United Kingdom
    Is it still worth logging a bug report or is it in the too hard basket?
    From the point of view of the development process, every reproducible problem should be logged, with a complete description of how to reproduce the problem. This should be done even if there is no prospect of the problem being fixed in the near or intermediate future.

    On the other hand, during the five years that I have been using MP, I have noticed numerous small bugs and things that don't work quite right, but I have not logged any of them. :eek: :cry:

    As regards the behaviour that you have found, there is still a possibility that it occurs because you are not using the correct combination of settings. Unfortunately, neither you nor I know what the correct combination of settings might be. :(

    The HID support seems to work correctly for most people, but that does not mean that it works correctly for everyone. For example, HTPC cases with built-in IR receivers often seem to cause problems, probably because they operate in some non-standard way, or require the use of non-standard software. The Ortek/Hama remote control also requires special processing (which is provided by the MP support for the "Centarea HID", and not by the general HID support).

    my final and cleanest fix (I hope) for anyone that may have the same problems as I had.
    One can waste a considerable amount of one's life trying different combinations of software and different settings in order to get something to work properly. I am pleased that you have found a combination that works in your system, without spending weeks doing so. It is a combination that would not have occurred to me, so well done for discovering this solution. :) (y)

    -- from CyberSimian in the UK
     

    macmr

    Portal Pro
    August 21, 2011
    105
    17
    Home Country
    Hi CyberSimian thanks for your reply. I will consider logging a bug report

    Just to clarify I am using a fresh install of MP 1.23 and PureVisionHD skin.

    Also to address ajs's post after some more testing based on what info he provided:

    In order to help, you need to understand what is going on. What a remote control. What are the click codes. Settings, etc. At the top, I brought a program that shows the click code. In mapping, you can assign the same action to pressing backspace that is performed when you press the ESC.

    I do know what is going on with the click codes as I have used the program you suggested to log them. It doesn't matter what remote control is being used as the issue can be found with a HID keyboard. So let's just concentrate on using a keyboard.

    In my testing today (which I had done before) I setup the config as per this HID Keyboard support. As you suggested I changed the "esc" key to "back" (which I assume is the "backspace" key option) and left all the actions for it the same.

    Now the "backspace" key did what the "esc" key used to do on all windows EXCEPT for when the dialog comes up when you want to start recording a tv show. The dialog that says "1- Current Program" "2 - Manual Stop". The "backspace" key will not close this dialog or the Mini EPG. Why not? It used to do it when the key was the "esc" key?

    So now in the mapping we have no "esc" key as all its actions have been reassigned to work off the "back" key. So why does the "esc" key still work when you are on fullscreen tv? I mean it isn't there anymore so how can the "esc" key do anything?

    I believe post #3 explains it all without having to go through it again.

    I have come up with a solution (post #6) that works for me.

    If ajs would like the logs then let me know and I will post in a few days.
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,369
    Kyiv
    Home Country
    Ukraine Ukraine
    As you suggested I changed the "esc" key to "back" (which I assume is the "backspace" key option) and left all the actions for it the same.
    I suggested not touching the ESC key, but touching the Backspace key. Those select Backspace and put the same action as the ESC key. :)
    Now the "backspace" key did what the "esc" key used to do on all windows EXCEPT for when the dialog comes up when you want to start recording a tv show. The dialog that says "1- Current Program" "2 - Manual Stop". The "backspace" key will not close this dialog or the Mini EPG. Why not? It used to do it when the key was the "esc" key?
    I don’t know how the TV plug-in works, but maybe @mm1352000 can help. :)

    But! You can try to add an additional action (when backspace pressed) in these windows.
    MiniEPG - Window ID - WINDOW_MINI_GUIDE = 3009 Action like: ACTION_PREVIOUS_MENU
    This Action close MiniEPG - MediaPortal/MediaPortal-1
    C#:
            case Action.ActionType.ACTION_PREVIOUS_MENU:
    I don’t know what type of dialog box is displayed in the given place, but if the solution with the MiniEPG works, I will find its ID. bottom :)
    How add Action with Condition (by Window ID) - [Finished] - [MP1-4795] Add keyboard support to HID handler

    PS: Similar problem? Remote has stopped working in "Pop-up" Menus
     
    Last edited:

    Users who are viewing this thread

    Top Bottom