Generic Keyboard/Remote Input Plugin (2 Viewers)

SilentException

Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    few problems i've noticed that make this plugin impossible to use for me:

    1. passing through keystrokes that are not mapped by this plug-in

    2. keyboard hook or something makes impossible for eventghost (external program) to catch the keystrokes

    3. passing *some* keys that are not mapped does work but after pressing ctrl+alt+del, and getting back to mediaportal nothing works other than the keys that are mapped

    4. even if i map all keys through this plugin, some keys arent't working as they should.. for example pressing numeric keys in teletext does not work (you cannot go to the page you want)
     

    corvy

    MP Donator
  • Premium Supporter
  • January 3, 2007
    209
    34
    47
    Rykkinn, Akershus
    Home Country
    Norway Norway
    Does the new version from 4th of November work with the newest SVN version aswell? (read somewhere that it broke last week or the week before).

    Thanks for this great plugin, without it my iMon remote is useless ;)
     

    rsenden

    Portal Pro
    August 22, 2006
    88
    108
    Rotterdam, NL
    Home Country
    Netherlands Netherlands
    Hi all,

    Here are some answers and remarks for some of the previous posts:
    • MediaPortal 'Key Pressed' action: By looking at the MediaPortal source, I think this doesn't actually generate a key press, but generates a MediaPortal 'key pressed' action event. If the specific MediaPortal feature actually listens for actual key presses instead of MediaPortal events, then the 'Key Pressed' action will not have any effect. By looking at the source, I think you can edit the Keyboard.xml file to use <action ... command="KEY" cmdProperty=" " ...> to actually send a space. See SendKeys method documentation (SendKeys Method) for valid cmdProperty values.
    • My test program seems to intercept key code 93 (context menu key) correctly, I will try to do some more testing with the actual plug-in in the near future.
    • The new keyboard handling mechanism uses a low-level keyboard hook. It is either this and being able to intercept as many keystrokes as possible, or using the original mechanism which intercepts only a limited set of keystrokes (no Win-keys and other special windows key combinations). The disadvantage of the new mechanism is that it may indeed influence other low-level keyboard utilities, has some issues with key pass-through, etc. I encountered a lot of problems with my own remote when using the new mechanism (for example keyup-events not fired), the current status is the best I've been able to get it so far. Of course, I will keep on tweaking the plug-in whenever I think I found an improvement (and as time permits). In a next version I will also add some more logging in order to help solving problems. Of course, any help with improving this plug-in is welcome.
    • I'm not sure whether this plug-in works with the latest SVN version; due to time constraints I only compile and test this plug-in against the latest released version (being 1.0 RC3).
    • Regarding any other questions, like learning additional keystrokes for a learning remote; I have no idea how to do this or whether it is at all possible.
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    • MediaPortal 'Key Pressed' action: By looking at the MediaPortal source, I think this doesn't actually generate a key press, but generates a MediaPortal 'key pressed' action event. If the specific MediaPortal feature actually listens for actual key presses instead of MediaPortal events, then the 'Key Pressed' action will not have any effect. By looking at the source, I think you can edit the Keyboard.xml file to use <action ... command="KEY" cmdProperty=" " ...> to actually send a space. See SendKeys method documentation (SendKeys Method) for valid cmdProperty values.

    been trying to do this.. i want to map not working buttons (like p, b and others) so i have this:

    <button name="Play (P)" code="80">
    <action layer="0" condition="*" conproperty="-1" command="KEY" cmdproperty="p" />
    </button>

    but it does not work :( am i editing the keyboard.xml the right way?
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    • MediaPortal 'Key Pressed' action: By looking at the MediaPortal source, I think this doesn't actually generate a key press, but generates a MediaPortal 'key pressed' action event. If the specific MediaPortal feature actually listens for actual key presses instead of MediaPortal events, then the 'Key Pressed' action will not have any effect. By looking at the source, I think you can edit the Keyboard.xml file to use <action ... command="KEY" cmdProperty=" " ...> to actually send a space. See SendKeys method documentation (SendKeys Method) for valid cmdProperty values.

    been trying to do this.. i want to map not working buttons (like p, b and others) so i have this:

    <button name="Play (P)" code="80">
    <action layer="0" condition="*" conproperty="-1" command="KEY" cmdproperty="p" />
    </button>

    but it does not work :( am i editing the keyboard.xml the right way?

    figured it out, cmdproperty=p is the right way to do it (without quotation marks)

    so you have to map every key you'd like to forward to mediaportal like that and everything works.

    but ctrl+alt+del still messes up the keyboard hook :/
     

    SilentException

    Retired Team Member
  • Premium Supporter
  • October 27, 2008
    2,617
    1,130
    Rijeka, Croatia
    Home Country
    Croatia Croatia
    • MediaPortal 'Key Pressed' action: By looking at the MediaPortal source, I think this doesn't actually generate a key press, but generates a MediaPortal 'key pressed' action event. If the specific MediaPortal feature actually listens for actual key presses instead of MediaPortal events, then the 'Key Pressed' action will not have any effect. By looking at the source, I think you can edit the Keyboard.xml file to use <action ... command="KEY" cmdProperty=" " ...> to actually send a space. See SendKeys method documentation (SendKeys Method) for valid cmdProperty values.

    been trying to do this.. i want to map not working buttons (like p, b and others) so i have this:

    <button name="Play (P)" code="80">
    <action layer="0" condition="*" conproperty="-1" command="KEY" cmdproperty="p" />
    </button>

    but it does not work :( am i editing the keyboard.xml the right way?

    figured it out, cmdproperty=p is the right way to do it (without quotation marks)

    so you have to map every key you'd like to forward to mediaportal like that and everything works.

    but ctrl+alt+del still messes up the keyboard hook :/

    ok, this was NOT the solution :) the plugin simply ignored my XML (coz it was invalid, no "") and used default one instead..


    but i have found the solution

    after messing around with the source code in KeyboardHandler.cs in function private void SendKey(string prefix, Keys key)

    SendKeys.Send(prefix + keyString);

    this is the line responsible for sending out the non-mapped keys. i have noticed that keyString was always uppercase.. converting it to lowercase did the trick and now any key not mapped by the plugin will be forwarded to mediaportal.. yay!

    so in a nutshell, alpha key strings in SendKeys.Send function must be lowercase

    i can upload fixed dll if anyone wants it..
     

    testimies

    Portal Pro
    October 12, 2007
    62
    3
    Espoo
    Home Country
    Finland Finland
    Hi

    I have same problems with RC4 and this plugin. It has halfly crippled mine remote. Only few buttons are working.

    I am interested in that fixed dll. Probably new version of this plugin is coming in some time but until then it would be good to have working version.
     

    awatrin

    MP Donator
  • Premium Supporter
  • December 7, 2008
    8
    0
    Home Country
    Brazil Brazil
    Hi, thanks for the great plugin! I'd like to know if there's a way to map a button as a shortcut to the main menu (the one with the options: layout, sort by, switch view, etc). Thanks in advance.
     

    Users who are viewing this thread

    Top Bottom