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="1stdead" data-source="post: 811676" data-attributes="member: 66469"><p>rsenden: I read the link provided above and someone said this:</p><p></p><p></p><p></p><p>Code how it was done:</p><p>[collapse]</p><p>void SomeMethod()</p><p>{</p><p> KeyboardHook hook = new KeyboardHook("Override minimize all");</p><p> </p><p> string errorMessage;</p><p> if (!hook.TrySetKeys(EnhancedKeys.WinLogo | EnhancedKeys.M, out errorMessage))</p><p> {</p><p> // If another hook already owns these keys, you will get an error here.</p><p> MessageBox.Show(errorMessage);</p><p> return;</p><p> }</p><p> </p><p> // Instead of minimizing all windows, WinLogo + M will now display</p><p> // this messagebox.</p><p> hook.Pressed += (s, e) =></p><p> {</p><p> MessageBox.Show("Pressed!");</p><p> };</p><p> </p><p> // Activate the hook.</p><p> hook.Engage();</p><p> </p><p> // Sometime later...</p><p> </p><p> // By default, the hook will only allow its Pressed event(s) to execute. To</p><p> // allow additional processing, set this property to true. In this example, setting</p><p> // AllowPassThrough to true will (1) display a message box and (2) minimize all windows.</p><p> hook.AllowPassThrough = true;</p><p> </p><p> // By default, the hook's Pressed event(s) will only execute once per key press. To</p><p> // continuously execute these events while the key is held down, set this to true.</p><p> hook.AutoRepeat = true;</p><p> </p><p> // Disengage to temporarily disconnect the hook from the system. To re-activate,</p><p> // call Engage() again.</p><p> hook.Disengage();</p><p> </p><p> // Kills off the hook. Don't forget to call Dispose or the hook's keys will remain</p><p> // unavailable until after its finalizer has executed. Dispose() calls Disengage() so</p><p> // it is not necessary to call both.</p><p> hook.Dispose();</p><p> </p><p> // Most of the rest is just informational</p><p> Console.WriteLine("Is alt key used: " + hook.Alt);</p><p> Console.WriteLine("Is shift key used: " + hook.Shift);</p><p> Console.WriteLine("Is win logo key used: " + hook.Windows);</p><p> Console.WriteLine("Is control key used: " + hook.Control);</p><p> Console.WriteLine("Current keys: " + hook.Keys);</p><p> Console.WriteLine("Current unmodified key: " + hook.UnmodifiedKey);</p><p> Console.WriteLine("Is hook active: " + hook.IsEngaged);</p><p> Console.WriteLine("Hook has no keys assigned: " + hook.IsEmpty);</p><p>}</p><p>[/collapse]</p><p></p><p></p><p>Would that be possible?</p></blockquote><p></p>
[QUOTE="1stdead, post: 811676, member: 66469"] rsenden: I read the link provided above and someone said this: Code how it was done: [collapse] void SomeMethod() { KeyboardHook hook = new KeyboardHook("Override minimize all"); string errorMessage; if (!hook.TrySetKeys(EnhancedKeys.WinLogo | EnhancedKeys.M, out errorMessage)) { // If another hook already owns these keys, you will get an error here. MessageBox.Show(errorMessage); return; } // Instead of minimizing all windows, WinLogo + M will now display // this messagebox. hook.Pressed += (s, e) => { MessageBox.Show("Pressed!"); }; // Activate the hook. hook.Engage(); // Sometime later... // By default, the hook will only allow its Pressed event(s) to execute. To // allow additional processing, set this property to true. In this example, setting // AllowPassThrough to true will (1) display a message box and (2) minimize all windows. hook.AllowPassThrough = true; // By default, the hook's Pressed event(s) will only execute once per key press. To // continuously execute these events while the key is held down, set this to true. hook.AutoRepeat = true; // Disengage to temporarily disconnect the hook from the system. To re-activate, // call Engage() again. hook.Disengage(); // Kills off the hook. Don't forget to call Dispose or the hook's keys will remain // unavailable until after its finalizer has executed. Dispose() calls Disengage() so // it is not necessary to call both. hook.Dispose(); // Most of the rest is just informational Console.WriteLine("Is alt key used: " + hook.Alt); Console.WriteLine("Is shift key used: " + hook.Shift); Console.WriteLine("Is win logo key used: " + hook.Windows); Console.WriteLine("Is control key used: " + hook.Control); Console.WriteLine("Current keys: " + hook.Keys); Console.WriteLine("Current unmodified key: " + hook.UnmodifiedKey); Console.WriteLine("Is hook active: " + hook.IsEngaged); Console.WriteLine("Hook has no keys assigned: " + hook.IsEmpty); } [/collapse] Would that be possible? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Generic Keyboard/Remote Input Plugin
Contact us
RSS
Top
Bottom