Skip to content

Commit

Permalink
Fix key listener behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
medengineer committed Jan 16, 2025
1 parent b44b1d6 commit f6ad170
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/SpikeSorterCanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ void SpikeSorterCanvas::setActiveElectrode (Electrode* electrode_)
void SpikeSorterCanvas::removeUnitOrBox()
{
int unitID, boxID;
if (electrode == nullptr)
return;
electrode->plot->getSelectedUnitAndBox (unitID, boxID);

bool selectNewBoxUnit = false;
Expand Down Expand Up @@ -245,10 +247,10 @@ bool SpikeSorterCanvas::keyPressed (const KeyPress& key, Component* c)
if (key.getKeyCode() == KeyPress::deleteKey || key.getKeyCode() == KeyPress::backspaceKey)
{
removeUnitOrBox();
return false;
return true;
}

return true;
return false;
}

void SpikeSorterCanvas::buttonClicked (Button* button)
Expand Down

0 comments on commit f6ad170

Please sign in to comment.