[Finished] [MP2-789] Keyboard shortcuts (1 Viewer)

Man Pang

Portal Pro
May 25, 2015
77
45
Home Country
United Kingdom United Kingdom
OK, I managed to implement the keyboard shortcuts and it was very simple. I found out in mainform.cs within the function
private void MainForm_KeyPress(object sender, KeyPressEventArgs e) I was able to check the value of key.name and call inputManager.KeyPress. For example:

if (key.Name == "p")


{

IInputManager inputManager = Common.ServiceRegistration.Get<IInputManager>();

inputManager.KeyPress(Key.Pause);


}

I will hardcode the keyboard shortcuts as I have no time to write a utility to allow users to map their own keys. However, I will store the keyboard shortcuts in a C# Dictionary collection, thus map key to action using the dictionary. Somebody else can write a simple utility to allow users to map their own keys and consequently replace the dictionary with the user-defined mappings.

I will commit the code in the next couple of days - need to work out how to commit code in GitHub
 
Last edited:

Timhoh1234

Portal Pro
September 29, 2015
252
90
Home Country
Germany Germany
I will hardcode the keyboard shortcuts as I have no time to write a utility to allow users to map their own keys. However, I will store the keyboard shortcuts in a C# Dictionary collection, thus map key to action using the dictionary. Somebody else can write a simple utility to allow users to map their own keys and consequently replace the dictionary with the user-defined mappings.

I will commit the code in the next couple of days - need to work out how to commit code in GitHub
Thanks! Just sad to hear, that you can not find time to complete an utility for users. Everybody in MP2 project seems out of time.
Is there something you change your mind? :notworthy:
 

ge2301

Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,741
    3,501
    Stuttgart
    Home Country
    Germany Germany
    @Man Pang
    Would be much appreciated, if you would try a step further. There is no time pressure and as mentioned everybody is really working hard.
    @osre can you not support and you finalize it as a team? :)
     

    osre

    Retired Team Member
  • Premium Supporter
  • December 14, 2014
    775
    387
    Home Country
    Germany Germany
    @ge2301 to finalize it, it Needs to be started first.
    I was hoping some of the MP1 developers woulod give me some advice on what to port to MP2 and what not.
    But it Looks like I have to figure that out by my self.
     

    Man Pang

    Portal Pro
    May 25, 2015
    77
    45
    Home Country
    United Kingdom United Kingdom
    For now, I have added a new class that handles the keyboard shortcuts but the keys are currently hardcoded. I think this is good enough to go into MP2 as it is. If I have time at a later date or for a later MP2 version, I can add a utility to enable users to specify their own keys.

    I have never used Git before and I am totally at a loss as to how to commit the changes into Git. I created a Git account and spent half an hour trying to commit the code within Visual Studio but without success. Any help on how to commit to Git will be welcome!
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,336
    Home Country
    Germany Germany
    I created a Git account and spent half an hour trying to commit the code within Visual Studio but without success. Any help on how to commit to Git will be welcome!
    You can't directly commit before having been invited by the developers to be allowed to contribute.

    @morpheus_xx , please consider if you'd like to give him access. At this time I have not yet written the respective Wiki part about our procedures.
     

    Users who are viewing this thread

    Similar threads

    MP1 MP2 Case Downsizing DE
    Most (all?) small PC cases accept only ITX motherboards, which have only one PCI-E slot. So you could install only one PCI-E tuner card. A quad-tuner card would give you four tuners, but if you wanted more tuners you would need to use the TBS eight-tuner card, or use external tuners, either USB tuners (available with single or dual...
    Most (all?) small PC cases accept only ITX motherboards, which have only one PCI-E slot. So you could install only one PCI-E tuner...
    I've been using MP2 now for about 3 years: I really happy with the way it works, although I can think of many great features I'd...
    Replies
    1
    Views
    403
    Ok, so perhaps a solution, but not the "right" solution. On the client, within media portal configuration, under TV settings, advanced options, I switched to UNC paths instead of the default RSS, and it's working very well. Sure I had to figure out the paths, but no big deal. Maybe helpful for someone in the future. Thanks for the...
    Ok, so perhaps a solution, but not the "right" solution. On the client, within media portal configuration, under TV settings...
    Hi folks. I have an issue with a new install/integration into my mediaportal system. I have a “mediaportal server” which has the TV...
    Replies
    5
    Views
    510
    You can always try, select any window, turn off the Media Portal, change the ID of the selected one to the desired one (plugin) and check.
    You can always try, select any window, turn off the Media Portal, change the ID of the selected one to the desired one (plugin) and...
    I don't have a TV card in my HTPC setup, so I really only use plugins that browse and show media files, like MP TV-Series, Moving...
    Replies
    5
    Views
    2K
    Hi, it looks like the Client's server connection settings got corrupted somehow and were reset, hopefully this is an easy fix. Open MP2-Client, navigate to Settings->General->Connectivity->Home server. In the menu on the left there may be an option Detach from home server, if there is click it and acknowledge the dialog that pops up...
    Hi, it looks like the Client's server connection settings got corrupted somehow and were reset, hopefully this is an easy fix...
    Help Please: MP doesnt display any of my previouse recordings or TV programs It seems like the Server isnt running? MP was working...
    Replies
    3
    Views
    753
    I avoid touching that system as long as it runs. Now that 2.4.1 seems to run again, I probably wait for the next issue.
    I avoid touching that system as long as it runs. Now that 2.4.1 seems to run again, I probably wait for the next issue.
    Hi, I have just upgraded from MP 2.2.2 to MP 2.4.1, and now the client won't start. I see the splash screen, and then it just...
    Replies
    3
    Views
    1K
    Top Bottom