Skip to content

Commit

Permalink
Plus key for zoom on Linux
Browse files Browse the repository at this point in the history
Unsatisfyingly, the plus key (shift-= on US keyboards) on linux
doesn't report the character '+' to onKeyDown in VSTGUI but rather
reports '=' with shift depressed. Ideally the keyboard layer would
handle keyboard mapping of course (it does on mac) but this is a
useful enough feature and common enough keyboard mapping that I
choose to make the ugly choice to also bind shift-= to zoom increase
which defacto fixes the +/- zoom on linux.

Closes surge-synthesizer#600: +/- key on linux zoom
  • Loading branch information
baconpaul committed Feb 26, 2019
1 parent 121ba9e commit a484e71
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/common/gui/SurgeGUIEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,18 @@ int32_t SurgeGUIEditor::onKeyDown(const VstKeyCode& code, CFrame* frame)
case '+':
setZoomFactor(getZoomFactor()+10);
return 1;
case '=':
/*
** This is a bit unsatisfying. The '+' key on linux with a US standard
** keyboard delivers as = with a shift modifier. I dislike hardcoding keyboard
** layouts but I don't see an API and this is a commonly used feature
*/
if (code.modifier == VstModifierKey::MODIFIER_SHIFT)
{
setZoomFactor(getZoomFactor()+10);
return 1;
}
break;
case '-':
setZoomFactor(getZoomFactor()-10);
return 1;
Expand Down

0 comments on commit a484e71

Please sign in to comment.