VirKeyboard: Fixed possible segfault

Fix to VirKeyboard, so invalid keys do not get registered.
Based upon recommendation by zenon48 in:
http://www.kvraudio.com/forum/viewtopic.php?t=266432
(cherry picked from commit b9e7cb07bd00780967c68d17deab2190e18a604d)
This commit is contained in:
fundamental
2009-11-18 08:29:05 -05:00
committed by Tobias Doerffel
parent d94b8882dd
commit d61283ad93
3 changed files with 5 additions and 2 deletions

View File

@@ -960,3 +960,6 @@
28 Oct 2009 (Paul Nasca)
- Disable "bw" control on Reverb when Bandwidth mode is not enabled
18 Nov 2009 (Mark McCurry)
- Fixed segfault in VirKeyBoard

View File

@@ -103,7 +103,7 @@ if ((event==FL_PUSH)||(event==FL_DRAG)||(event==FL_RELEASE)){
};
};
if (((event==FL_PUSH)||(event==FL_DRAG))&&
if ((keypos!=-1)&&((event==FL_PUSH)||(event==FL_DRAG))&&
(Fl::event_shift()==0)) {
presskey(kpos,1,1);
};

View File

@@ -138,7 +138,7 @@ if ((event==FL_PUSH)||(event==FL_DRAG)||(event==FL_RELEASE)){
};
};
if (((event==FL_PUSH)||(event==FL_DRAG))&&
if ((keypos!=-1)&&((event==FL_PUSH)||(event==FL_DRAG))&&
(Fl::event_shift()==0)) {
presskey(kpos,1,1);
};