本文整理汇总了TypeScript中neuroglancer/util/event_action_map.EventActionMap.fromObject方法的典型用法代码示例。如果您正苦于以下问题:TypeScript EventActionMap.fromObject方法的具体用法?TypeScript EventActionMap.fromObject怎么用?TypeScript EventActionMap.fromObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类neuroglancer/util/event_action_map.EventActionMap
的用法示例。
在下文中一共展示了EventActionMap.fromObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}