home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Menu dialog Plugin
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="pilehave" data-source="post: 573546" data-attributes="member: 71550"><p>Your plugin should be created as a process-plugin and start when MediaPortal starts. Then it should hook the eventlistener and check it an action matches the one you define. Use some parts of the guide here:</p><p><a href="http://wiki.team-mediaportal.com/MediaPortal1_Development/PluginDevelopersGuide" target="_blank">MediaPortal1_Development/PluginDevelopersGuide - MediaPortal Manual Documentation</a></p><p>and replace</p><p></p><p>[CODE]public class Class1 : GUIWindow, ISetupForm[/CODE]</p><p></p><p>with</p><p></p><p>[CODE]public class Class1 : IPlugin, ISetupForm[/CODE]</p><p></p><p>and replace</p><p></p><p>[CODE]</p><p> // Get Windows-ID</p><p> public int GetWindowId()</p><p> {</p><p> // WindowID of windowplugin belonging to this setup</p><p> // enter your own unique code</p><p> return 5678;</p><p> } </p><p>[/CODE]</p><p></p><p>with</p><p></p><p>[CODE]</p><p> // Get Windows-ID</p><p> public int GetWindowId()</p><p> {</p><p> // WindowID of windowplugin belonging to this setup</p><p> // enter your own unique code</p><p> return -1;</p><p> }</p><p>[/CODE]</p><p></p><p>That should actually be enough to change a window-plugin to a process-plugin.</p><p></p><p>Then place the eventlistener</p><p></p><p>[CODE]GUIGraphicsContext.OnNewAction += new OnActionHandler(OnAction);[/CODE]</p><p></p><p>in the</p><p></p><p>[CODE]</p><p> public void Start()</p><p> {</p><p> }</p><p>[/CODE]</p><p></p><p>function. Now you can check keystrokes, buttonpushes etc. in your OnAction function. Like this:</p><p></p><p>[CODE]</p><p>public void OnAction(Action action)</p><p>{</p><p>if(action.wID == Action.ActionType.ACTION_MOVE_DOWN) //user navigated down (key-down or remote-down or...</p><p>{</p><p>//do something</p><p>}</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="pilehave, post: 573546, member: 71550"] Your plugin should be created as a process-plugin and start when MediaPortal starts. Then it should hook the eventlistener and check it an action matches the one you define. Use some parts of the guide here: [url=http://wiki.team-mediaportal.com/MediaPortal1_Development/PluginDevelopersGuide]MediaPortal1_Development/PluginDevelopersGuide - MediaPortal Manual Documentation[/url] and replace [CODE]public class Class1 : GUIWindow, ISetupForm[/CODE] with [CODE]public class Class1 : IPlugin, ISetupForm[/CODE] and replace [CODE] // Get Windows-ID public int GetWindowId() { // WindowID of windowplugin belonging to this setup // enter your own unique code return 5678; } [/CODE] with [CODE] // Get Windows-ID public int GetWindowId() { // WindowID of windowplugin belonging to this setup // enter your own unique code return -1; } [/CODE] That should actually be enough to change a window-plugin to a process-plugin. Then place the eventlistener [CODE]GUIGraphicsContext.OnNewAction += new OnActionHandler(OnAction);[/CODE] in the [CODE] public void Start() { } [/CODE] function. Now you can check keystrokes, buttonpushes etc. in your OnAction function. Like this: [CODE] public void OnAction(Action action) { if(action.wID == Action.ActionType.ACTION_MOVE_DOWN) //user navigated down (key-down or remote-down or... { //do something } [/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Menu dialog Plugin
Contact us
RSS
Top
Bottom