How to use ng-keyboard-shortcuts - 5 common examples

To help you get started, we’ve selected a few ng-keyboard-shortcuts 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 omridevk / ng-keyboard-shortcuts / src / app / home / home.component.ts View on Github external
preventDefault: true,
                command: e => console.log("clicked shift + n" , e.key)
            },
            {
                key: "N",
                label: "help",
                description: "big N",
                preventDefault: true,
                command: e => console.log("clicked big N" , e.key)
            },
            {
                key: "~",
                label: "help",
                description: "~ sign",
                preventDefault: true,
                allowIn: [AllowIn.Textarea, AllowIn.Input, AllowIn.Select],
                command: e => console.log("clicked ~ sign" , e.key)
            },
            {
                key: "?",
                label: "help",
                description: "Question mark",
                preventDefault: true,
                allowIn: [AllowIn.Textarea, AllowIn.Input, AllowIn.Select],
                command: e => console.log("clicked question mark" , e.key)
            },
            {
                key: "ctrl + ?",
                label: "help",
                description: "Shift + Question mark",
                preventDefault: true,
                allowIn: [AllowIn.Textarea, AllowIn.Input, AllowIn.Select],
github omridevk / ng-keyboard-shortcuts / src / app / home / home.component.ts View on Github external
command: e => console.log("clicked big N" , e.key)
            },
            {
                key: "~",
                label: "help",
                description: "~ sign",
                preventDefault: true,
                allowIn: [AllowIn.Textarea, AllowIn.Input, AllowIn.Select],
                command: e => console.log("clicked ~ sign" , e.key)
            },
            {
                key: "?",
                label: "help",
                description: "Question mark",
                preventDefault: true,
                allowIn: [AllowIn.Textarea, AllowIn.Input, AllowIn.Select],
                command: e => console.log("clicked question mark" , e.key)
            },
            {
                key: "ctrl + ?",
                label: "help",
                description: "Shift + Question mark",
                preventDefault: true,
                allowIn: [AllowIn.Textarea, AllowIn.Input, AllowIn.Select],
                command: e => console.log("clicked ctrl + question mark" , e.key)
            },
            {
                key: "f2",
                preventDefault: true,
                label: "help",
                description: "Open Help menu",
                allowIn: [AllowIn.Textarea],
github omridevk / ng-keyboard-shortcuts / src / app / home / home.component.ts View on Github external
command: e => console.log("clicked ~ sign" , e.key)
            },
            {
                key: "?",
                label: "help",
                description: "Question mark",
                preventDefault: true,
                allowIn: [AllowIn.Textarea, AllowIn.Input, AllowIn.Select],
                command: e => console.log("clicked question mark" , e.key)
            },
            {
                key: "ctrl + ?",
                label: "help",
                description: "Shift + Question mark",
                preventDefault: true,
                allowIn: [AllowIn.Textarea, AllowIn.Input, AllowIn.Select],
                command: e => console.log("clicked ctrl + question mark" , e.key)
            },
            {
                key: "f2",
                preventDefault: true,
                label: "help",
                description: "Open Help menu",
                allowIn: [AllowIn.Textarea],
                command: e => console.log("clicked " , e.key)
            },
            {
                key: "cmd + ?",
                command: (output: ShortcutEventOutput) => console.log(output),
                preventDefault: true,
                throttleTime: 250,
            },
github JP1016 / Markdown-Electron / src / app / navbar / navbar.component.ts View on Github external
},
      {
        key: ["cmd + shift + L", "ctrl + shift + L"],
        allowIn: [AllowIn.Textarea],
        command: e => this.markDown.optionChanged.next(OPTION.LIST),
        preventDefault: true
      },
      {
        key: ["cmd + shift + C", "ctrl + shift + C"],
        allowIn: [AllowIn.Textarea],
        command: e => this.markDown.optionChanged.next(OPTION.CHECK_BOX),
        preventDefault: true
      },
      {
        key: ["cmd + shift + Q", "ctrl + shift + Q"],
        allowIn: [AllowIn.Textarea],
        command: e => this.markDown.optionChanged.next(OPTION.BLOCK_QUOTE),
        preventDefault: true
      },
      {
        key: ["cmd + shift + D", "ctrl + shift + D"],
        allowIn: [AllowIn.Textarea],
        command: e => this.markDown.optionChanged.next(OPTION.CODE),
        preventDefault: true
      },
      {
        key: ["cmd + shift + T", "ctrl + shift + T"],
        allowIn: [AllowIn.Textarea],
        command: e => this.markDown.optionChanged.next(OPTION.TABLE),
        preventDefault: true
      },
      {
github omridevk / ng-keyboard-shortcuts / src / app / app.module.ts View on Github external
import { NgModule } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { AppComponent } from "./app.component";
import { KeyboardShortcutsModule } from "ng-keyboard-shortcuts";
import { AppRoutingModule } from './app-routing.module';
import { GettingStartedComponent } from './getting-started/getting-started.component';
import { HomeComponent } from './home/home.component';
import { MaterialModule } from "./material-module";

@NgModule({
    imports: [
        BrowserModule,
        KeyboardShortcutsModule.forRoot(),
        BrowserAnimationsModule,
        MaterialModule,
        AppRoutingModule,
    ],
    declarations: [AppComponent, GettingStartedComponent, HomeComponent],
    bootstrap: [AppComponent]
})
export class AppModule {}

ng-keyboard-shortcuts

Dead Simple Keyboard Shortcuts Management for Angular 2+

MIT
Latest version published 10 months ago

Package Health Score

58 / 100
Full package analysis