zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 182935144824207bb518d9de2fc03411649ba7de
parent 6eff03c89f336930edb87422543d2017e9af5da2
Author: fundamental <mark.d.mccurry@gmail.com>
Date:   Tue, 16 Jun 2009 09:43:12 -0400

Fixed possible VirKey::preskey() crash

Bug report:
https://sourceforge.net/tracker/?func=detail&aid=2789754&group_id=62934&atid=502312

Diffstat:
Msrc/UI/VirKeyboard.fl | 12+++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/UI/VirKeyboard.fl b/src/UI/VirKeyboard.fl @@ -37,11 +37,11 @@ decl {const int keysoct1dw[]={'\\'','2',',','3','.','p','5','y','6','f','7','g', decl {const int keysoct2dw[]={';','o','q','e','j','k','i','x','d','b','h','m','w','n','v','s','z',0};} {} -decl {const int keysoct1qwertz[]={'q','2','w','3','e','r','5','t','6','z','7','u','i','9','o','0','p',252,'\\\'','+','\\\\',FL_Enter,0};} {} +decl {const int keysoct1qwertz[]={'q','2','w','3','e','r','5','t','6','z','7','u','i','9','o','0','p',252,'\\'','+','\\\\',FL_Enter,0};} {} decl {const int keysoct2qwertz[]={'y','s','x','d','c','v','g','b','h','n','j','m',',','l','.',246,'-',0};} {} -class VirKeys {open : {public Fl_Box} +class VirKeys {: {public Fl_Box} } { decl {static const int N_OCT=6;} {} decl {static const int SIZE_WHITE=14;} {} @@ -179,11 +179,14 @@ return(1);} {} } Function {presskey(int nk,int exclusive,int type)} {selected } { - code {if (nk>=N_OCT*12) return; + code {//Exclusive means that multiple keys can be pressed at once +//when the user uses the shift key +if (nk>=N_OCT*12) return; if ((nk<0)&&(exclusive==0)) { relaseallkeys(type); return; }; +if (nk<0) return; if (pressed[nk]!=0) return;//the key is already pressed if (exclusive!=0) relaseallkeys(type); @@ -228,8 +231,7 @@ pthread_mutex_unlock(&master->mutex);} {} } } -class VirKeyboard {open -} { +class VirKeyboard {} { Function {make_window()} {} { Fl_Window virkeyboardwindow { label {Virtual Keyboard - ZynAddSubFX}