[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,705
    3,491
    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,335
    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

    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
    902
    MP1 MP2 MP2 - V2.5 No genres after upgrade to 2.5 DE
    You need to check the wiki for TVMosaic, you have recordings as source available once TVM is installed. And of course images and music are part of the NET6 version as for NET4. If you have issues with it further infos would be good.
    You need to check the wiki for TVMosaic, you have recordings as source available once TVM is installed. And of course images and...
    Make sure that your system (Windows, codecs and drivers) is up to date, matching the Requirements and you've filled in your System...
    Replies
    10
    Views
    1K
    Thanks for the info. Now I know how to create logs. I remapped the keys and, for the moment, after using MP2 several times, they function well. If the mapping disappears again, I'll send you some logs. Thank you!
    Thanks for the info. Now I know how to create logs. I remapped the keys and, for the moment, after using MP2 several times, they...
    Hi, I changed recently from MP1 to MP2 and I'm very happy with the change. But I still have to learn quite a few things. Sorry if...
    Replies
    4
    Views
    1K
    Any other suggestions for this?
    Any other suggestions for this?
    I have Flirc and the Skip 1s remote sending volume +/- events. I prefer to rely on just the Windows volume control so in...
    Replies
    4
    Views
    507
    I guess from this, that the mapping steps basically work. Please try to map some of the keys you mention to be not working and upload the log files afterwards. Maybe @Brownard can see something and a solution can be found. Please open a thread in the OnlineVideo section for this, we should not mix 2 topics in one thread.
    I guess from this, that the mapping steps basically work. Please try to map some of the keys you mention to be not working and...
    I am having trouble to make my remote control work correctly on MP2. Having upgraded from MP1 to MP2 where the remote using the...
    Replies
    24
    Views
    3K
    Top Bottom