MP 1.12: Changing from Centarea Remote to Generic HID - how to map Buttons properly? (3 Viewers)

Stéphane Lenclud

Retired Team Member
  • Premium Supporter
  • April 29, 2013
    2,576
    1,294
    Home Country
    Germany Germany
    I probably mentioned that earlier but the way forward for those dodgy input handlers is to get ride of them.
    If a remote is sending keyboard shortcuts then only our keyboard handler should be involved.
    Ideally we would need to have multiple keyboard profile so that people can select the one that fit their dodgy remote.
    Keyboard handler should also be able to support multiple key/shortcut per action.
     
    Last edited:

    Stéphane Lenclud

    Retired Team Member
  • Premium Supporter
  • April 29, 2013
    2,576
    1,294
    Home Country
    Germany Germany
    I guess what I'm saying is that if you are having problems with those funky remote then just enable HID, disable all other hamdler and change the keyboard mapping to match those of your remote.
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,974
    1,854
    Southampton
    Home Country
    United Kingdom United Kingdom
    My curiosity finally got the better of me and I re-installed MP 1.09-final in my test partition. I used the on-screen keyboard in "Search in Titles" to test the Ortek/Hama, and can confirm what has been stated previously -- in earlier releases of MP, a real keyboard can be used to enter text strings in the normal fashion. However, I did notice one quirk. :(

    While typing the text string, if one mistypes a character, it is natural to want to use the BACKSPACE key to erase the last character typed and then type the correct one. This does not work. Instead, when the BACKSPACE key is pressed, MP returns to the previous panel. This of course is because WMC uses BACKSPACE to mean "return to previous panel", and the "Centarea HID" converts BACKSPACE into ESCAPE.

    This behaviour is entirely to be expected, because the "Centarea HID" cannot identify the origin of a keystroke, and so must apply the same mappings to keystrokes from the keyboard as it does to button presses from the remote. Nevertheless, I found it quite irritating that I could not correct typing errors using backspace. :mad:

    The lesson to take from this is:

    (1) Use of the Ortek/Hama with the "Centarea HID" is not transparent -- it affects keyboard handling.

    (2) The affect on keyboard handling cannot be corrected by fixing the regression that was introduced in MP 1.12 (or earlier).

    -- from CyberSimian in the UK
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,974
    1,854
    Southampton
    Home Country
    United Kingdom United Kingdom
    I am currently investigating a possible workaround for the keyboard problem.
    I have continued to investigate this, and I have now identified what additional definitions are needed in "Centarea HID.xml" in order to workaround the regression present in MP 1.12/1.13. But the solution will definitely have some disadvantages, which may make it unacceptable.

    My testing regime is to use the on-screen keyboard ("Virtual Keyboard") in "Search in Titles" in the TV menu, and the objective is to be able to use a real keyboard to type a text string. Typing upper and lower case alphabetics now works, as does typing numeric digits (both the qwerty digits and the numpad digits). But typing the miscellaneous characters presented more of a problem, which I have only just solved.

    On my UK keyboard there are 36 miscellaneous characters, some of which I use in the names of recordings (e.g. "(", ")", "[", "]", "-", "_", "."). I would therefore want to be able to type these when using the "File Rename" dialogue (which also uses the on-screen keyboard). The problem with the miscellaneous characters can be illustrated by considering the right parenthesis ")" as an example.

    The ")" character has a decimal value of 41, so I initially created a definition for code="41"; but that did not work. Since on the UK keyboard the parentheses are on the uppercase shift, I thought that the SHIFT flag might be set, so I then tried code="1041" (the first "1" is the flag for the SHIFT key); but that did not work either. It finally occurred to me that the "Centarea HID" might be receiving the decimal value for the unshifted key, which on the UK keyboard is "0". So I tried the value for SHIFT_0, which is code="1048", and that worked! :)

    But now we have a problem, because the locations of the miscellaneous characters on the keyboard vary from one country to another. The result is that every country would need to have its own version of "Centarea HID.xml". :( I will provide a version for the UK keyboard, and I think that most programmers will be able to modify it for their locality. But I think that it would be too difficult for someone who is not an experienced computer professional. :(

    Another problem concerns the BACKSPACE key that I described in my previous post. I added two further definitions: one allows BACKSPACE to pass through unchanged in the on-screen keyboard (so it works as normal), and the other maps ESCAPE to "return to previous panel". So this provides normal behaviour for the keyboard in MP. But what are the side effects?

    The first is the effect on the remote control. When in the on-screen keyboard, the "Return" button on the remote now acts as BACKSPACE, and not as "Return". Instead, the "Clear" button now acts as "Return".

    The other effect is using the keyboard to navigate within MP. Although ESCAPE in the on-screen keyboard acts as "return to previous panel", on all other panels it is BACKSPACE that does that. :eek: Now it would be possible to modify the definitions so that ESCAPE acted as "return to previous panel" everywhere within MP. But that would result in the "Return" button on the remote never acting as "Return"; it would always be the "Clear" button that acted as "Return".

    So, it is possible to get consistent behaviour using the keyboard and using the remote, but at the cost of a few buttons on the remote not performing their expected functions. Would this be acceptable? Maybe yes, maybe no. :confused:

    In conclusion I would say that there is no free lunch. There are two reasons for choosing the Ortek/Hama remote:

    (1) It does not suffer from the toggle-codes bug that is present in the driver for the "Microsoft eHome Infrared Transceiver".

    (2) The IR receiver does not go AWOL when waking from sleep or hibernation.

    and these are the reasons why I purchased it. Nevertheless, I would still recommend MP users purchasing:

    a WMC-compatible RC6 remote control that is sold with its own IR reciever which plugs into a USB socket.

    -- from CyberSimian in the UK

    PS: I will post my completed "Centarea HID.xml" file in a day or two.
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,974
    1,854
    Southampton
    Home Country
    United Kingdom United Kingdom
    I am currently investigating a possible workaround for the keyboard problem.
    And here it is. :)

    But be advised that this is a "first draft". It probably contains various errors, and the definitions are not as complete as I would like (I got bored :eek:). Nevertheless, it should be a "usable start".

    Comments, criticisms, and contributions (in the form of additional definitions) welcome. :D

    -- from CyberSimian in the UK

    Edit 2016-10-15:
    I have released an improved version of the config file and AutoHotKey script, which can be found here:
    https://forum.team-mediaportal.com/...te-control-vrc-1100.94301/page-6#post-1198295
     

    Attachments

    • Centarea HID 2016-01-14.zip
      10.3 KB
    Last edited:

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,974
    1,854
    Southampton
    Home Country
    United Kingdom United Kingdom
    I have updated the zip file in post 36 with three bug fixes (two fixes in the AutoHotKey script, and one in the XML file). See the end of the file "Centarea HID.txt" for details.

    -- from CyberSimian in the UK
     

    joecrow

    Test Group
  • Team MediaPortal
  • August 9, 2012
    2,660
    2,002
    Home Country
    Germany Germany
    @CyberSimian
    Good work, great to get an update for the Hama/Ortek remote.:) I have run into a problem though, if I attempt to navigate a Bluray menu, using the internal BD handler up/down buttons only work very intermittently/slowly. I works fine with the old .xml.
    Also a couple of questions:-
    Shift+1on the keyboard does not get me the detailed video info, I note you have mapped it to the virtual keyboard as an exclamation mark, when playing a video should that be passed on, or do I need to change the mapping to "Show Stat"?
    I am not familier with AHK how should I set that up?
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,974
    1,854
    Southampton
    Home Country
    United Kingdom United Kingdom
    if I attempt to navigate a Bluray menu, using the internal BD handler up/down buttons only work very intermittently/slowly.
    One of the really weird things about the support for the Centarea HID is the inconsistency in the way that it behaves. Buttons behave differently for no apparent reason :confused:, and the challenge is to identify those differences and include fix-ups in the "Centarea HID" xml file. But this mostly comes down to trial and error, rather than any overall understanding of the way that it is supposed to work. :(

    I don't have any blu-ray disks, so I have not tested that part of MP :(. You will need to experiment with different definitions for the UP/DOWN buttons in the hope that you can find definitions that work correctly.
    The previous definitions for those buttons would be an obvious place to start -- try those first. However, you should make the revised definitions specific to the window(s) concerned, to avoid perturbing the behaviour in other windows.

    If you identify definitions that work better than the current ones, please post them here and I will add them to the master definition. :)

    Shift+1on the keyboard does not get me the detailed video info, I note you have mapped it to the virtual keyboard as an exclamation mark, when playing a video should that be passed on, or do I need to change the mapping to "Show Stat"?
    With effect from MP 1.12, the general rule seems to be: if there is no explicit definition for a character, the character is thrown away. So if you want a character to be passed to a panel, there needs to be a definition for that character in the xml file.

    Upper case alphabetics are done differently from lower case alphabetics for reasons related to "quick find" in lists (upper case) and keyboard shortcuts (lower case). The miscellaneous characters can probably be done either way. Either of the following should work:

    (1) Add conditional definitions for the exclamation mark to pass it to the panel when the panel is any of the fullscreen video panels (live TV, recorded TV, video, DVD). I will add this to the master definition. :)

    (2) Define a button on the remote to invoke the "Show Stat" function (as you did before). (Note to others: the "Show Stat" function is not available on the remote control prior to MP 1.13.) This is convenient if you have a spare button on the remote, but as it is not part of the "standard" definition for the Microsoft MCE remote, I won't add this to the master definition.

    I am not familier with AHK how should I set that up?
    I have included some instructions on how to use "AutoHotKey in the "Centarea HID.ahk" file. I hope that it is enough to get you started. Ask again if you are unclear (but I am no expert in the use of AutoHotKey!).

    -- from CyberSimian in the UK
     

    CyberSimian

    Test Group
  • Team MediaPortal
  • June 10, 2013
    2,974
    1,854
    Southampton
    Home Country
    United Kingdom United Kingdom
    (1) Add conditional definitions for the exclamation mark to pass it to the panel when the panel is any of the fullscreen video panels (live TV, recorded TV, video, DVD). I will add this to the master definition.
    I have just tried this, but unfortunately I cannot get it to work :(. Keyboard shortcuts when passed through to the panel do work (e.g. "h" for the "Home" panel), but the "!" character does not. I would speculate that the "!" is processed differently from keyboard shortcuts.

    The alternative of defining "!" to invoke the "Show Stats" function should work (I tried it with the "Show Info" function), but unfortunately the "Show Stats" function is not available in releases of MP prior to 1.13. :(

    -- from CyberSimian in the UK
     

    Users who are viewing this thread

    Top Bottom