當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript keyboard_shortcut_handler.KeySequenceMap類代碼示例

本文整理匯總了TypeScript中neuroglancer/util/keyboard_shortcut_handler.KeySequenceMap的典型用法代碼示例。如果您正苦於以下問題:TypeScript KeySequenceMap類的具體用法?TypeScript KeySequenceMap怎麽用?TypeScript KeySequenceMap使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了KeySequenceMap類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: constructor

  /**
   * @param keyMap Key map to list.
   */
  constructor(keyMap: KeySequenceMap) {
    super();

    let {content} = this;
    content.classList.add('describe-key-bindings');

    let scroll = document.createElement('div');

    let dl = document.createElement('div');
    dl.className = 'dl';

    for (let [sequence, command] of keyMap.entries()) {
      let container = document.createElement('div');
      let container2 = document.createElement('div');
      container2.className = 'definition-outer-container';
      container.className = 'definition-container';
      let dt = document.createElement('div');
      dt.className = 'dt';
      dt.textContent = sequence.map(formatKeyStroke).join(' ');
      let dd = document.createElement('div');
      dd.className = 'dd';
      dd.textContent = command;
      container.appendChild(dt);
      container.appendChild(dd);
      dl.appendChild(container2);
      container2.appendChild(container);
    }
    scroll.appendChild(dl);
    content.appendChild(scroll);
  }
開發者ID:funkey,項目名稱:neuroglancer,代碼行數:33,代碼來源:key_bindings.ts

示例2: makeDefaultKeyBindings

export function makeDefaultKeyBindings(keyMap: KeySequenceMap) {
  keyMap.bind('arrowleft', 'x-');
  keyMap.bind('arrowright', 'x+');
  keyMap.bind('arrowup', 'y-');
  keyMap.bind('arrowdown', 'y+');
  keyMap.bind('comma', 'z-');
  keyMap.bind('period', 'z+');
  keyMap.bind('keyz', 'snap');
  keyMap.bind('control+equal', 'zoom-in');
  keyMap.bind('control+shift+equal', 'zoom-in');
  keyMap.bind('control+minus', 'zoom-out');
  keyMap.bind('keyr', 'rotate-relative-z-');
  keyMap.bind('keye', 'rotate-relative-z+');
  keyMap.bind('shift+arrowdown', 'rotate-relative-x-');
  keyMap.bind('shift+arrowup', 'rotate-relative-x+');
  keyMap.bind('shift+arrowleft', 'rotate-relative-y-');
  keyMap.bind('shift+arrowright', 'rotate-relative-y+');
  keyMap.bind('keyl', 'recolor');
  keyMap.bind('keyx', 'clear-segments');
  keyMap.bind('keys', 'toggle-show-slices');
  keyMap.bind('keyb', 'toggle-scale-bar');
  keyMap.bind('keya', 'toggle-axis-lines');

  for (let i = 1; i <= 9; ++i) {
    keyMap.bind('digit' + i, 'toggle-layer-' + i);
  }

  keyMap.bind('keyn', 'add-layer');
  keyMap.bind('keyh', 'help');

  keyMap.bind('space', 'toggle-layout');
}
開發者ID:funkey,項目名稱:neuroglancer,代碼行數:32,代碼來源:default_key_bindings.ts

示例3: makeExtraKeyBindings

export function makeExtraKeyBindings(keyMap: KeySequenceMap) {
  keyMap.bind('keyo', 'navigate-to-origin');
}
開發者ID:funkey,項目名稱:neuroglancer,代碼行數:3,代碼來源:extra_key_bindings.ts


注:本文中的neuroglancer/util/keyboard_shortcut_handler.KeySequenceMap類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。