Howto get Keys in a process-plugin? (1 Viewer)

Thor2605

MP Donator
  • Premium Supporter
  • April 2, 2009
    1,640
    184
    Home Country
    Germany Germany
    I want to get the Keys from the Keyboard to my process plugin...

    I tried this way:

    #region IPluginReceiver Members

    bool IPluginReceiver.WndProc(ref System.Windows.Forms.Message msg)
    {
    if (msg.Msg == WM_APP && msg.WParam.ToInt32() == ID_MESSAGE_COMMAND)
    {

    if (msg.LParam.ToInt32() == intCode)
    {
    //Do something
    }

    return true;
    }

    return false;
    }

    #endregion

    But there I have the problem, that SendMessagePlugin doesn't work anymore if I activate my plugin!


    So I want to read the keys from Keyboard! Does MediaPortal gives a function for that?

    Thanks!
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,657
    3,133
    Nuenen
    Home Country
    Netherlands Netherlands
    I want to get the Keys from the Keyboard to my process plugin...

    I tried this way:

    #region IPluginReceiver Members

    bool IPluginReceiver.WndProc(ref System.Windows.Forms.Message msg)
    {
    if (msg.Msg == WM_APP && msg.WParam.ToInt32() == ID_MESSAGE_COMMAND)
    {

    if (msg.LParam.ToInt32() == intCode)
    {
    //Do something
    }

    return true;
    }

    return false;
    }

    #endregion

    But there I have the problem, that SendMessagePlugin doesn't work anymore if I activate my plugin!


    So I want to read the keys from Keyboard! Does MediaPortal gives a function for that?

    Thanks!

    I think you have to override the OnAction(Action action) method, and catch the keypresses there like:
    switch (action.wID)
    case Action.ActionType.ACTION_KEY_PRESSED:
    char pressedChar = (char)action.m_key.KeyChar;
     

    Users who are viewing this thread

    Top Bottom