How to use the roosterjs-editor-core.Keys.Ctrl function in roosterjs-editor-core

To help you get started, we’ve selected a few roosterjs-editor-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / roosterjs / packages / roosterjs-editor-plugins / lib / ContentEdit / features / shortcutFeatures.ts View on Github external
return cacheGetEventData(event, 'DEFAULT_SHORT_COMMAND', () => {
        let e = event.rawEvent;
        let key =
            // Need to check ALT key to be false since in some language (e.g. Polski) uses AltGr to input some special charactors
            // In that case, ctrlKey and altKey are both true in Edge, but we should not trigger any shortcut function here
            event.eventType == PluginEventType.KeyDown && !e.altKey
                ? e.which |
                  (e.metaKey && Keys.Meta) |
                  (e.shiftKey && Keys.Shift) |
                  (e.ctrlKey && Keys.Ctrl)
                : 0;
        return key && commands.filter(cmd => (Browser.isMac ? cmd.macKey : cmd.winKey) == key)[0];
    });
}