another attempt to get rid of the bugs reported in MUSR-115 (d-f-d, f-d-f issues in the key event handling of musrview
This commit is contained in:
@ -721,6 +721,18 @@ void PMusrCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
|
||||
// handle keys and popup menu entries
|
||||
enum eKeySwitch {kNotRelevant, kData, kDiffData, kFourier, kDiffFourier, kFourierDiff};
|
||||
eKeySwitch relevantKeySwitch = kNotRelevant;
|
||||
static eKeySwitch lastKeySwitch = kNotRelevant;
|
||||
|
||||
if ((lastKeySwitch == kFourierDiff) && (x == 'f')) {
|
||||
cout << "debug> f-d-f doesn't make any sense, will ignore 'f' ..." << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((lastKeySwitch == kDiffFourier) && (x == 'd')) {
|
||||
cout << "debug> d-f-d doesn't make any sense, will ignore 'd' ..." << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (x == 'q') { // quit
|
||||
Done(0);
|
||||
} else if (x == 'd') { // difference
|
||||
@ -813,6 +825,8 @@ void PMusrCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
|
||||
fMainCanvas->Update();
|
||||
}
|
||||
|
||||
lastKeySwitch = relevantKeySwitch;
|
||||
|
||||
// call the apropriate functions if necessary
|
||||
switch (relevantKeySwitch) {
|
||||
case kData: // show data
|
||||
|
Reference in New Issue
Block a user