Skip to content

Commit 5935f6c

Browse files
committed
Heavy console: Better way to detect keyboard shortcuts
1 parent fe89cfe commit 5935f6c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Source/Heavy/ExportingProgressView.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,15 @@ class ExporterConsole : public Component
9898

9999
bool keyPressed(const KeyPress& key) override
100100
{
101-
// Ctrl+C or Cmd+C to copy
102-
if ((key.getModifiers().isCtrlDown() || key.getModifiers().isCommandDown()) &&
103-
key.getKeyCode() == 'C')
101+
if (key == KeyPress('c', ModifierKeys::commandModifier, 0)) {
104102
{
105103
if (hasSelection())
106104
{
107105
copySelectionToClipboard();
108106
return true;
109107
}
110108
}
111-
// Ctrl+A or Cmd+A to select all
112-
else if ((key.getModifiers().isCtrlDown() || key.getModifiers().isCommandDown()) &&
113-
key.getKeyCode() == 'A')
109+
else if (key == KeyPress('a', ModifierKeys::commandModifier, 0)) {
114110
{
115111
updateGlyphPositions();
116112

0 commit comments

Comments
 (0)