NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 37 38 39 40 41 … 93 Next »
KeyMappings - PVRX2 - BaseButtonUIList

 
  • 0 Vote(s) - 0 Average
KeyMappings - PVRX2 - BaseButtonUIList
psycik
Offline

Posting Freak

Posts: 5,210
Threads: 424
Joined: Sep 2005
#1
2007-12-16, 07:07 AM
Hi

Got some info on the Ky mappings:

Quote:Here is some info about using the key mappings. Its pretty straight forward, but if you have any questions, just ask

Code:
Declare a variable of type GBPVR.Public.KeyCommandHelper:
    private KeyCommandHelper keyHelper;

Initialise that variable in your plugin's initialisation function:
Code:
keyHelper = new KeyCommandHelper("TVGuide.xml");

In OnKeyDown() check for commands:

Code:
public bool OnKeyDown(KeyEventArgs e)
    {
       ....
        switch (keyHelper.KeyMapping(e))
        {
             case "GUIDE_SEARCH":    
             .... do some processing
             break;

But on base button UI List, I'm not actually doing any keycode processing, since it's being handled but the base classes.

So my question is, will it use the keymapping file, and if so, how do I tell it to use it?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,717
Threads: 767
Joined: Nov 2003
#2
2007-12-16, 04:06 PM
The default handling for the base button UI List doesnt need to the key mappings since it doesnt do any special key handling. It only handles the up/down/left/right/enter/escape keys, which dont use the key mappings.

In your plugin though, you can still use the key mappings for any extra custom keys you want to handle. Pretty much as it says above, declare a member variable for the KeyCommandHelper, then when you override OnKeyDown to do any special keys use the key mapping stuff.

Code:
protected override void initialise()
        {
            keyHelper = new KeyCommandHelper("MyPlugin.xml");
            ...
            ... any other initialisation
            ...

            // allow base class to be initialised
            base.initialise();
        }

Code:
public override bool OnKeyDown(KeyEventArgs e)
        {
            ....
            switch (keyHelper.KeyMapping(e))
            {
               case "PLUGIN_SEARCH":    
               .... do some processing
               break;
            }

            // let base class handle other keystrokes
            return base.OnKeyDown(e);
        }
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Is the input file for pvrx2.exe -import unique to NextPVR? spinnaker 1 1,779 2013-10-08, 02:25 AM
Last Post: sub
  KeyMappings imilne 5 2,680 2011-07-26, 10:00 PM
Last Post: mvallevand
  Keymappings in NPVR scb147 2 1,742 2010-08-03, 04:10 PM
Last Post: scb147
  KeyMappings McBainUK 1 1,674 2010-02-13, 10:28 PM
Last Post: sub
  pvrx2 / plugin assembly resolution bgowland 6 2,362 2009-02-05, 11:14 PM
Last Post: bgowland
  Displaying web pages in pvrx2 psycik 4 2,044 2009-01-23, 07:59 PM
Last Post: psycik
  Opening an external program from PVRX2 mkenyon2 1 1,312 2009-01-06, 10:05 PM
Last Post: pastro
  Aspect ratio for PVRX2 application Hairy 3 1,887 2008-11-09, 04:52 PM
Last Post: Hairy
  Threads in Plugins won't terminate when PVRX2/GBPVR exits ralphy 6 2,262 2007-09-28, 12:39 PM
Last Post: sub
  PVRX2 Plugin in Config all psycik 7 2,410 2007-08-18, 03:29 AM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode