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
Generic Keyboard/Remote Input 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="rsenden" data-source="post: 811599" data-attributes="member: 24295"><p>Hi Enanno,</p><p></p><p>Did you reboot after the registry change? If not, please do so and retry.</p><p></p><p>I can see that the plugin captures the first Alt+Enter; on the second Alt+Enter it detects that the keyboard handler is disabled and as such could not capture it. I guess if you would press Alt+Enter multiple times after that, it will again sometimes be handled by the plugin, sometimes by MediaPortal itself. Currently the only known work-around is the registry hack unfortunately.</p><p></p><p>I think the plug-in could be improved to prevent the keyboard hook time-out. Currently all processing (looking up the key mapping and actually executing the related action) is done on the same thread as the keyboard hook itself. In order to improve this, the following steps should be taken:</p><p></p><ul> <li data-xf-list-type="ul">Add functionality to InputHandler to store all mapped keycodes in a simple HashSet for quick lookup, and add a method IsMapped(keycode). For performance reasons, we could ignore conditions (e.g. once a key is defined in the mapping, the plugin will always 'eat' it independent of whether it is actually mapped under the current conditions).</li> <li data-xf-list-type="ul">KeyboardInputPluginMain.KeyboardHandler_KeyPressHandler currently calls _inputHandler.MapAction, which will both look up whether there is a mapping for the given key/button code, and if so, execute the corresponding action. This should be changed such that actually executing the action is performed on a separate thread. So, the relevant code in KeyboardHandler_KeyPressHandler could for example look something like this: [code]<br /> bool isMapped = InputHandler.IsMapped(keycode); <br /> if ( isMapped) { postToActionThread(keycode); }<br /> return isMapped;[/code]</li> </ul><p></p><p>Unfortunately, I lack the C#/.NET experience needed to quickly implement the threading mechanism (and I don't have time to delve into this). Anyone willing to help implement this? The source code can be found in the MP-Plugins SVN at <a href="https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/KeyboardInputPlugin/" target="_blank">https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/KeyboardInputPlugin/</a> (see <a href="https://forum.team-mediaportal.com/mediaportal-plugins-47/plugin-development-svn-15863/" target="_blank">https://forum.team-mediaportal.com/mediaportal-plugins-47/plugin-development-svn-15863/</a> for information on getting write access).</p></blockquote><p></p>
[QUOTE="rsenden, post: 811599, member: 24295"] Hi Enanno, Did you reboot after the registry change? If not, please do so and retry. I can see that the plugin captures the first Alt+Enter; on the second Alt+Enter it detects that the keyboard handler is disabled and as such could not capture it. I guess if you would press Alt+Enter multiple times after that, it will again sometimes be handled by the plugin, sometimes by MediaPortal itself. Currently the only known work-around is the registry hack unfortunately. I think the plug-in could be improved to prevent the keyboard hook time-out. Currently all processing (looking up the key mapping and actually executing the related action) is done on the same thread as the keyboard hook itself. In order to improve this, the following steps should be taken: [LIST] [*]Add functionality to InputHandler to store all mapped keycodes in a simple HashSet for quick lookup, and add a method IsMapped(keycode). For performance reasons, we could ignore conditions (e.g. once a key is defined in the mapping, the plugin will always 'eat' it independent of whether it is actually mapped under the current conditions). [*]KeyboardInputPluginMain.KeyboardHandler_KeyPressHandler currently calls _inputHandler.MapAction, which will both look up whether there is a mapping for the given key/button code, and if so, execute the corresponding action. This should be changed such that actually executing the action is performed on a separate thread. So, the relevant code in KeyboardHandler_KeyPressHandler could for example look something like this: [code] bool isMapped = InputHandler.IsMapped(keycode); if ( isMapped) { postToActionThread(keycode); } return isMapped;[/code] [/LIST] Unfortunately, I lack the C#/.NET experience needed to quickly implement the threading mechanism (and I don't have time to delve into this). Anyone willing to help implement this? The source code can be found in the MP-Plugins SVN at [url]https://mp-plugins.svn.sourceforge.net/svnroot/mp-plugins/trunk/plugins/KeyboardInputPlugin/[/url] (see [url]https://forum.team-mediaportal.com/mediaportal-plugins-47/plugin-development-svn-15863/[/url] for information on getting write access). [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Generic Keyboard/Remote Input Plugin
Contact us
RSS
Top
Bottom