mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Fix for shift-delete shortcut in text editors
This commit is contained in:
parent
d46ea64aa5
commit
301dfaf501
1 changed files with 7 additions and 6 deletions
|
|
@ -85,12 +85,6 @@ struct TextEditorKeyMapper
|
|||
if (key.isKeyCode (KeyPress::pageDownKey)) return target.pageDown (isShiftDown);
|
||||
}
|
||||
|
||||
if (numCtrlAltCommandKeys < 2)
|
||||
{
|
||||
if (key.isKeyCode (KeyPress::backspaceKey)) return target.deleteBackwards (ctrlOrAltDown);
|
||||
if (key.isKeyCode (KeyPress::deleteKey)) return target.deleteForwards (ctrlOrAltDown);
|
||||
}
|
||||
|
||||
if (key == KeyPress ('c', ModifierKeys::commandModifier, 0)
|
||||
|| key == KeyPress (KeyPress::insertKey, ModifierKeys::ctrlModifier, 0))
|
||||
return target.copyToClipboard();
|
||||
|
|
@ -103,6 +97,13 @@ struct TextEditorKeyMapper
|
|||
|| key == KeyPress (KeyPress::insertKey, ModifierKeys::shiftModifier, 0))
|
||||
return target.pasteFromClipboard();
|
||||
|
||||
// NB: checking for delete must happen after the earlier check for shift + delete
|
||||
if (numCtrlAltCommandKeys < 2)
|
||||
{
|
||||
if (key.isKeyCode (KeyPress::backspaceKey)) return target.deleteBackwards (ctrlOrAltDown);
|
||||
if (key.isKeyCode (KeyPress::deleteKey)) return target.deleteForwards (ctrlOrAltDown);
|
||||
}
|
||||
|
||||
if (key == KeyPress ('a', ModifierKeys::commandModifier, 0))
|
||||
return target.selectAll();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue