| 980 | } |
| 981 | |
| 982 | void ModularSynth::KeyPressed(int key, bool isRepeat) |
| 983 | { |
| 984 | mLastShiftPressTime = -9999; //reset timer for detecing double-shift press, so it doens't happen while typing |
| 985 | |
| 986 | if (!isRepeat) |
| 987 | mHideTooltipsUntilMouseMove = true; |
| 988 | |
| 989 | if (gHoveredUIControl && |
| 990 | IKeyboardFocusListener::GetActiveKeyboardFocus() == nullptr && |
| 991 | !isRepeat) |
| 992 | { |
| 993 | if (key == OF_KEY_DOWN || key == OF_KEY_UP || key == OF_KEY_LEFT || key == OF_KEY_RIGHT) |
| 994 | { |
| 995 | if (GetKeyModifiers() != kModifier_Command) |
| 996 | { |
| 997 | float inc; |
| 998 | if (key == OF_KEY_LEFT) |
| 999 | inc = -1; |
| 1000 | else if (key == OF_KEY_RIGHT) |
| 1001 | inc = 1; |
| 1002 | else if ((key == OF_KEY_DOWN && gHoveredUIControl->InvertScrollDirection() == false) || |
| 1003 | (key == OF_KEY_UP && gHoveredUIControl->InvertScrollDirection() == true)) |
| 1004 | inc = -1; |
| 1005 | else |
| 1006 | inc = 1; |
| 1007 | if (GetKeyModifiers() & kModifier_Shift) |
| 1008 | inc *= .01f; |
| 1009 | gHoveredUIControl->Increment(inc); |
| 1010 | } |
| 1011 | } |
| 1012 | else if (key == '[') |
| 1013 | { |
| 1014 | gHoveredUIControl->Halve(); |
| 1015 | } |
| 1016 | else if (key == ']') |
| 1017 | { |
| 1018 | gHoveredUIControl->Double(); |
| 1019 | } |
| 1020 | else if (key == '\\') |
| 1021 | { |
| 1022 | gHoveredUIControl->ResetToOriginal(); |
| 1023 | } |
| 1024 | else if ((toupper(key) == 'C' || toupper(key) == 'X') && GetKeyModifiers() == kModifier_Command) |
| 1025 | { |
| 1026 | TheSynth->CopyTextToClipboard(ofToString(gHoveredUIControl->GetValue())); |
| 1027 | } |
| 1028 | else if (key != ' ' && key != OF_KEY_TAB && key != '`' && key < CHAR_MAX && juce::CharacterFunctions::isPrintable((char)key) && (GetKeyModifiers() & kModifier_Alt) == false) |
| 1029 | { |
| 1030 | gHoveredUIControl->AttemptTextInput(); |
| 1031 | } |
| 1032 | } |
| 1033 | |
| 1034 | if (key == OF_KEY_ESC && PatchCable::sActivePatchCable != nullptr) |
| 1035 | { |
| 1036 | PatchCable::sActivePatchCable->Release(); |
| 1037 | return; |
| 1038 | } |
| 1039 |
nothing calls this directly
no test coverage detected