diff --git a/GUI/Widgets/Fl_Canvas.C b/GUI/Widgets/Fl_Canvas.C index 1668499..e4b1e2e 100644 --- a/GUI/Widgets/Fl_Canvas.C +++ b/GUI/Widgets/Fl_Canvas.C @@ -603,7 +603,7 @@ int Fl_Canvas::handle(int event) m_HaveSelection = false; } - if ((Fl::event_state() & FL_CTRL) != 0) + if (((Fl::event_state() & FL_CTRL) != 0) || ((Fl::event_state() & FL_SHIFT) != 0)) { m_Selecting = true; m_StartSelectX=Fl::event_x(); @@ -700,7 +700,7 @@ int Fl_Canvas::handle(int event) } } - if ((Fl::event_button()==3) && (event==FL_PUSH) && ((Fl::event_state() & FL_CTRL) != 0)) + if ((Fl::event_button()==3) && (event==FL_PUSH)) { PopupEditMenu(this); } diff --git a/GUI/Widgets/Fl_Canvas.h b/GUI/Widgets/Fl_Canvas.h index 750eae4..522880a 100644 --- a/GUI/Widgets/Fl_Canvas.h +++ b/GUI/Widgets/Fl_Canvas.h @@ -204,27 +204,35 @@ private: PopupEditMenu(widget->parent()); } - if ((widget) && (button==1) && ((shift_state & FL_CTRL) != 0)) - { + if ((widget) && (button==1)) + { int ID = ((Fl_DeviceGUI*)(widget->parent()))->GetID(); std::vector::iterator device_iter = std::find(m_Selection.m_DeviceIds.begin(), m_Selection.m_DeviceIds.end(), ID); - if (m_HaveSelection) - { - if (device_iter != m_Selection.m_DeviceIds.end()) - m_Selection.m_DeviceIds.erase(device_iter); + if (((shift_state & FL_SHIFT) != 0) || ((shift_state & FL_CTRL) != 0)) + { + if (m_HaveSelection) + { + if (device_iter != m_Selection.m_DeviceIds.end()) + m_Selection.m_DeviceIds.erase(device_iter); + else + m_Selection.m_DeviceIds.push_back(ID); + } else - m_Selection.m_DeviceIds.push_back(ID); - } + { + m_Selection.Clear(); + m_HaveSelection = true; + m_Selection.m_DeviceIds.push_back(ID); + } + } else { m_Selection.Clear(); m_HaveSelection = true; m_Selection.m_DeviceIds.push_back(ID); } - - redraw(); - } + redraw(); + } } inline void cb_DeleteDeviceGroup_i();