Change control modifier to regular ASCII caret
This commit is contained in:
@ -22,12 +22,13 @@ describe('hotkeyDisplay', () => {
|
||||
expect(hotkeyDisplay('alt+c', 'linux')).toEqual('Alt+C')
|
||||
})
|
||||
it('displays ctrl', async () => {
|
||||
expect(hotkeyDisplay('ctrl+c', 'macos')).toEqual('⌃C')
|
||||
expect(hotkeyDisplay('ctrl+c', 'macos')).toEqual('^C')
|
||||
expect(hotkeyDisplay('ctrl+c', 'windows')).toEqual('Ctrl+C')
|
||||
expect(hotkeyDisplay('ctrl+c', 'linux')).toEqual('Ctrl+C')
|
||||
})
|
||||
it('displays multiple modifiers', async () => {
|
||||
expect(hotkeyDisplay('shift+alt+ctrl+c', 'windows')).toEqual('Shift+Alt+Ctrl+C')
|
||||
expect(hotkeyDisplay('shift+alt+ctrl+c', 'windows')).toEqual(
|
||||
'Shift+Alt+Ctrl+C'
|
||||
)
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
@ -68,9 +68,11 @@ export function hotkeyDisplay(hotkey: string, platform: Platform): string {
|
||||
.replaceAll(WHITESPACE, ' ')
|
||||
.replaceAll('mod', isMac ? '⌘' : 'Ctrl')
|
||||
.replaceAll('meta', isMac ? '⌘' : meta)
|
||||
// Note: This is *not* the ASCII caret character. It's "UP ARROWHEAD".
|
||||
// Unicode: U+2303.
|
||||
.replaceAll('ctrl', isMac ? '⌃' : 'Ctrl')
|
||||
// This is technically the wrong arrow for control, but it's more visible
|
||||
// and recognizable. May want to change this in the future.
|
||||
//
|
||||
// The correct arrow is ⌃ "UP ARROWHEAD" Unicode: U+2303
|
||||
.replaceAll('ctrl', isMac ? '^' : 'Ctrl')
|
||||
// This is technically the wrong arrow for shift, but it's more visible and
|
||||
// recognizable. May want to change this in the future.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user