Skip to content

Handled key event #28

@savian-net

Description

@savian-net

I am handling the key chord (CTRL+,) w/o an issue. However, the key chord fires my event and then inserts the comma afterward. Is there a way to handle the keybpoard event so the keyboard knows it is handled?

var ImportStylesListener = new KeyChordEventSource(keyboard, new ChordClick(KeyCode.Control, KeyCode.Oemcomma)); ImportStylesListener.Triggered += (x, y) => ImportStylesListener_Triggered(keyboard, x, y); ImportStylesListener.Reset_On_Parent_EnabledChanged = false; ImportStylesListener.Enabled = true;

private void ImportStylesListener_Triggered(IKeyboardEventSource Keyboard, object sender, KeyChordEventArgs e) { if (Globals.ThisAddIn.Application.Documents.Count == 0) { return; } Log.Info($"Command executed using shortcut: Import Styles (CTRL+,)"); using (Keyboard.Suspend()) { e.Input.Next_Hook_Enabled = false; Common.WCRibbon.ExecuteImportStylesForm(); } //WindowsInput.Simulate.Events().Click(KeyCode.Control).Invoke(); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions