GUI: even more piano work

- don't allow piano window to be moved if clicking on piano
- only treat left click as a touch point
This commit is contained in:
tildearrow 2022-05-18 00:23:13 -05:00
parent cfa05143ab
commit 255fc4cc25
2 changed files with 3 additions and 0 deletions

View File

@ -2314,6 +2314,7 @@ void FurnaceGUI::processPoint(SDL_Event& ev) {
break;
}
case SDL_MOUSEBUTTONDOWN: {
if (ev.button.button!=SDL_BUTTON_LEFT) break;
for (size_t i=0; i<activePoints.size(); i++) {
TouchPoint& point=activePoints[i];
if (point.id==-1) {
@ -2332,6 +2333,7 @@ void FurnaceGUI::processPoint(SDL_Event& ev) {
break;
}
case SDL_MOUSEBUTTONUP: {
if (ev.button.button!=SDL_BUTTON_LEFT) break;
for (size_t i=0; i<activePoints.size(); i++) {
TouchPoint& point=activePoints[i];
if (point.id==-1) {

View File

@ -209,6 +209,7 @@ void FurnaceGUI::drawPiano() {
// render piano
//ImGui::ItemSize(size,ImGui::GetStyle().FramePadding.y);
if (ImGui::ItemAdd(rect,ImGui::GetID("pianoDisplay"))) {
ImGui::ItemHoverable(rect,ImGui::GetID("pianoDisplay"));
if (view) {
int notes=oct*12;
// evaluate input