Skip to content

Commit

Permalink
Update Windows shortcuts to match Windows shortcut standard styling (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhabib committed Feb 29, 2024
1 parent cb3c427 commit 6ad5895
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/early-months-fold.md
@@ -0,0 +1,5 @@
---
'playroom': patch
---

Update shortcut format for Windows users for consistency with standard styling.
7 changes: 4 additions & 3 deletions src/Playroom/SettingsPanel/SettingsPanel.tsx
Expand Up @@ -23,16 +23,17 @@ import { isMac } from '../../utils/formatting';
const getKeyBindings = () => {
const metaKeySymbol = isMac() ? '⌘' : 'Ctrl';
const altKeySymbol = isMac() ? '⌥' : 'Alt';
const shiftKeySymbol = isMac() ? '⇧' : 'Shift';

return {
'Toggle comment': [metaKeySymbol, '/'],
'Wrap selection in tag': [metaKeySymbol, '⇧', ','],
'Wrap selection in tag': [metaKeySymbol, shiftKeySymbol, ','],
'Format code': [metaKeySymbol, 'S'],
'Select next occurrence': [metaKeySymbol, 'D'],
'Swap line up': [altKeySymbol, '↑'],
'Swap line down': [altKeySymbol, '↓'],
'Duplicate line up': ['⇧', altKeySymbol, '↑'],
'Duplicate line down': ['⇧', altKeySymbol, '↓'],
'Duplicate line up': [shiftKeySymbol, altKeySymbol, '↑'],
'Duplicate line down': [shiftKeySymbol, altKeySymbol, '↓'],
'Add cursor to prev line': [metaKeySymbol, altKeySymbol, '↑'],
'Add cursor to next line': [metaKeySymbol, altKeySymbol, '↓'],
};
Expand Down
2 changes: 1 addition & 1 deletion src/Playroom/Toolbar/Toolbar.tsx
Expand Up @@ -81,7 +81,7 @@ export default ({ themes: allThemes, widths: allWidths, snippets }: Props) => {
{hasSnippets && (
<ToolbarItem
active={isSnippetsOpen}
title={`Insert snippet (${isMac() ? '\u2318' : 'Ctrl + '}K)`}
title={`Insert snippet (${isMac() ? '⌘K' : 'Ctrl+K'})`}
disabled={!validCursorPosition}
data-testid="toggleSnippets"
onClick={() => {
Expand Down

0 comments on commit 6ad5895

Please sign in to comment.