-
Notifications
You must be signed in to change notification settings - Fork 262
Open
Description
Exactly what the title is asking.
After briefly reading, I can see that you can suppress mouse and key events using e.handled (like this)
private void GlobalHookMouseDownExt(object sender, MouseEventExtArgs e)
{
Console.WriteLine("MouseDown: \t{0}; \t System Timestamp: \t{1}", e.Button, e.Timestamp);
// uncommenting the following line will suppress the middle mouse button click
// if (e.Buttons == MouseButtons.Middle) { e.Handled = true; }
}I'm trying to use a keyboard shortcut in my tray application but testing in visual studio often opens up context menus which is a little annoying.
Is there a way to suppress the keyboard combination after it is activated? (so it doesn't trigger further combinations in the focused application)
// code I currently have; subscribe and unsubscribe are linked to form_load and form_closed events
private IKeyboardMouseEvents _globalHook;
public void Subscribe()
{
_globalHook = Hook.GlobalEvents();
_globalHook.OnCombination(new Dictionary<Combination, Action> {
{Combination.FromString("Shift+Alt+D"), QuickDictionaryShortcut}
});
}
public void Unsubscribe()
{
_globalHook.Dispose();
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels