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


TypeScript event_action_map.EventActionMap類代碼示例

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


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

示例1: getDefaultRenderedDataPanelBindings

export function getDefaultRenderedDataPanelBindings() {
  if (defaultRenderedDataPanelBindings === undefined) {
    defaultRenderedDataPanelBindings = EventActionMap.fromObject(
        {
          'arrowleft': 'x-',
          'arrowright': 'x+',
          'arrowup': 'y-',
          'arrowdown': 'y+',
          'comma': 'z-',
          'period': 'z+',
          'keyz': 'snap',
          'control+equal': 'zoom-in',
          'control+shift+equal': 'zoom-in',
          'control+minus': 'zoom-out',
          'keyr': 'rotate-relative-z-',
          'keye': 'rotate-relative-z+',
          'shift+arrowdown': 'rotate-relative-x-',
          'shift+arrowup': 'rotate-relative-x+',
          'shift+arrowleft': 'rotate-relative-y-',
          'shift+arrowright': 'rotate-relative-y+',

          'at:control+wheel': {action: 'zoom-via-wheel', preventDefault: true},
          'at:wheel': {action: 'z+1-via-wheel', preventDefault: true},
          'at:shift+wheel': {action: 'z+10-via-wheel', preventDefault: true},
          'at:dblclick0': 'select',
          'at:control+mousedown0': 'annotate',
          'at:mousedown2': 'move-to-mouse-position',
          'at:control+mousedown2': 'select-annotation',
        },
        {label: 'All Data Panels'});
  }
  return defaultRenderedDataPanelBindings;
}
開發者ID:stephenplaza,項目名稱:neuroglancer,代碼行數:33,代碼來源:default_input_event_bindings.ts

示例2: getDefaultPerspectivePanelBindings

export function getDefaultPerspectivePanelBindings() {
  if (defaultPerspectivePanelBindings === undefined) {
    defaultPerspectivePanelBindings = EventActionMap.fromObject(
        {
          'at:mousedown0': {action: 'rotate-via-mouse-drag', stopPropagation: true},
          'at:shift+mousedown0': {action: 'translate-via-mouse-drag', stopPropagation: true},
          'at:touchtranslate1': 'rotate-out-of-plane-via-touchtranslate',
        },
        {parents: [[getDefaultRenderedDataPanelBindings(), Number.NEGATIVE_INFINITY]]});
  }
  return defaultPerspectivePanelBindings;
}
開發者ID:google,項目名稱:neuroglancer,代碼行數:12,代碼來源:default_input_event_bindings.ts

示例3: getDefaultGlobalBindings

export function getDefaultGlobalBindings() {
  if (defaultGlobalBindings === undefined) {
    const map = new EventActionMap();
    map.set('keyl', 'recolor');
    map.set('keyx', 'clear-segments');
    map.set('keys', 'toggle-show-slices');
    map.set('keyb', 'toggle-scale-bar');
    map.set('shift+keyb', 'toggle-default-annotations');
    map.set('keya', 'toggle-axis-lines');
    map.set('keyo', 'toggle-orthographic-projection');

    for (let i = 1; i <= 9; ++i) {
      map.set('digit' + i, 'toggle-layer-' + i);
      map.set('control+digit' + i, 'select-layer-' + i);
    }

    map.set('keyn', 'add-layer');
    map.set('keyh', 'help');

    map.set('space', 'toggle-layout');
    map.set('shift+space', 'toggle-layout-alternative');
    defaultGlobalBindings = map;
  }
  return defaultGlobalBindings;
}
開發者ID:stephenplaza,項目名稱:neuroglancer,代碼行數:25,代碼來源:default_input_event_bindings.ts

示例4: makeExtraKeyBindings

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


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