diff --git a/src/core/main/init/toolbar.tsx b/src/core/main/init/toolbar.tsx index a7d36da..9e89058 100644 --- a/src/core/main/init/toolbar.tsx +++ b/src/core/main/init/toolbar.tsx @@ -55,9 +55,32 @@ function DefaultTool(props: CustomToolbarProps) { function KeyTool(props: CustomToolbarProps<'hotkey'>) { const { item, toolbar } = props; + + const unwarpAssist = (assist: number) => { + let res = ''; + if (assist & (1 << 0)) { + res += 'Ctrl + '; + } + if (assist & (1 << 1)) { + res += 'Shift + '; + } + if (assist & (1 << 2)) { + res += 'Alt + '; + } + return res; + }; + + const getKeyShow = (key: KeyCode, assist: number) => { + return unwarpAssist(assist) + KeyCodeUtils.toString(key); + }; + return ( - toolbar.emitTool(item.id)}> - {KeyCodeUtils.toString(item.key)} + toolbar.emitTool(item.id)} + > + {getKeyShow(item.key, item.assist)} ); }