StarUML documentation
v3
v3
  • Introduction
  • User Guide
    • Introduction
    • Basic Concepts
    • Managing Project
    • Editing Elements
    • Formatting Diagram
    • Managing Extensions
    • User Interface
    • Validation Rules
    • Keyboard Shortcuts
  • Working with Diagrams
    • Class Diagram
    • Package Diagram
    • Composite Structure Diagram
    • Object Diagram
    • Component Diagram
    • Deployment Diagram
    • Use Case Diagram
    • Sequence Diagram
    • Communication Diagram
    • Statechart Diagram
    • Activity Diagram
    • Profile Diagram
    • Entity-Relationship Diagram
    • Flowchart Diagram
    • Data Flow Diagram
  • Developing Extensions
    • Getting Started
    • Commands
    • Menus
    • Keymaps
    • Accessing Elements
    • Creating and Modifying Elements
    • Working with Selections
    • Defining Preferences
    • Using Dialogs
    • Registering to Extension Registry
Powered by GitBook
On this page
  1. Developing Extensions

Keymaps

A command may have a corresponding keyboard shortcut. You can define key bindings for commands in keymap JSON files like below:

{
  "ctrl-n": "application:new",
  "ctrl-c": "edit.copy",
  ...
}

Key binding should be a combination of following keys with - separator.

  • Character literals : a, 1, ,, ...

  • Modifier keys : ctrl, cmd, shift, alt, cmdctrl (cmdctrl is automatically recognized in cmd in MacOS and ctrl in Windows and Linux and alt is corresponds to option key in MacOS)

  • Special keys : enter, space, up, down, left, right, delete, tab, escape, backspace, home, end, pageup, pagedown

The key bindings is shown in menu items of the same commands automatically.

The keymap JSON files should be placed in keymaps/ folder of the extension and the keymap files are loaded in alphabetical order.

my-extension/
└─ keymaps/
   └─ keymap.json
PreviousMenusNextAccessing Elements

Last updated 6 years ago