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
Plugin strings and keys...
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="Inker" data-source="post: 123537" data-attributes="member: 10541"><p>Well, for overwriting keys....I don't think you should overwrite them. Generally you would react to ACTIONS (which are caused by the user pressing whatever key, be it on the remote or keyboard, that the user has assigned to that ACTION. In the plugin you then intercept the ACTION (and not a keypress directly) and react accordingly.</p><p></p><p>Lets say you wanted to do something when the user presses stop (which defaults to the 'b' button the keyboard, but the user can overwrite this in the configuration to whatever key he/she wants. The code would look something like this:</p><p></p><p>[CODE]public override void OnAction(Action action)</p><p>{</p><p> switch (action.wID)</p><p> {</p><p> case Action.ActionType.ACTION_STOP:</p><p> // do whatever here</p><p> break;</p><p> default:</p><p> // let MP handle all other actions</p><p> base.OnAction(action);</p><p> break;</p><p> }</p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="Inker, post: 123537, member: 10541"] Well, for overwriting keys....I don't think you should overwrite them. Generally you would react to ACTIONS (which are caused by the user pressing whatever key, be it on the remote or keyboard, that the user has assigned to that ACTION. In the plugin you then intercept the ACTION (and not a keypress directly) and react accordingly. Lets say you wanted to do something when the user presses stop (which defaults to the 'b' button the keyboard, but the user can overwrite this in the configuration to whatever key he/she wants. The code would look something like this: [CODE]public override void OnAction(Action action) { switch (action.wID) { case Action.ActionType.ACTION_STOP: // do whatever here break; default: // let MP handle all other actions base.OnAction(action); break; } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Plugin strings and keys...
Contact us
RSS
Top
Bottom