[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
251
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,725
    3,521
    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,382
    2,369
    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

    Nevermind, I think. I found them in the forum. I had only checked the main webiste for MP2 plugins. https://www.team-mediaportal.com/extensions/mp2-plugins I hope these work: Featured Plugins
    Nevermind, I think. I found them in the forum. I had only checked the main webiste for MP2 plugins...
    I've been an MP1 user for a long time. I'm interested in switching to MP2. However, I rely heavily on the features provided by...
    Replies
    1
    Views
    3K
    Attached are new TV service logs with your latest DLL. I see lots of EPG events and none of the messages from earlier. Congratulations!
    Attached are new TV service logs with your latest DLL. I see lots of EPG events and none of the messages from earlier. Congratulations!
    I have some weird behavior trying to operate the MP GUI in a new installation of MP 1.36 under Windows 11 Pro. Some of the remote...
    Replies
    33
    Views
    8K
    Hello, Name need to be the same as computer name. Also, logs could be useful.
    Hello, Name need to be the same as computer name. Also, logs could be useful.
    It is a bit of a long story! I successfully installed MP2 on my old PC as client/server with client on my laptop to confirm my...
    Replies
    2
    Views
    1K
    4.5 is really old. I'm not sure 4.5.5 even is a version that actually existed. You should be able to install .NET Framework 4.8.0 on Windows 7 SP1
    4.5 is really old. I'm not sure 4.5.5 even is a version that actually existed. You should be able to install .NET Framework 4.8.0...
    My TV PC is more a cast-off on older hardware (a 'Quiet PC' i5 4690, 16GB ram, 2xSSD 1xHDD, system graphics), mainly as a cheap way...
    Replies
    5
    Views
    2K
    maybe setting loglevel to debug might pinpoint the difference between normal and stuck? Preferable with as much disabled as possible also try to see if anything is happening during stuck for the mediaportal process(resource monitor, disk activity, cpu usage, anything) maybe other programs competing for resouces?
    maybe setting loglevel to debug might pinpoint the difference between normal and stuck? Preferable with as much disabled as...
    Since over a year my MP sometimes stucks while showing the welcome screen. It started once a week now it happens every second time...
    Replies
    4
    Views
    1K
    Top Bottom