diff --git a/src/hexeditor.cc b/src/hexeditor.cc index 8086b25..a9215c9 100644 --- a/src/hexeditor.cc +++ b/src/hexeditor.cc @@ -763,12 +763,22 @@ void HexEditor::handleReplace() { } void HexEditor::handleMouse() { +#ifdef _WIN32 + if (getmouse() == 0) return; + + int mx = Mouse_status.x; + int my = Mouse_status.y; + + if (!(Mouse_status.button[0] & BUTTON1_PRESSED) + || (Mouse_status.changes & 0x01)) return; +#else MEVENT event; if (getmouse(&event) != OK) return; if (!(event.bstate & BUTTON1_PRESSED)) return; int mx = event.x; int my = event.y; +#endif if (my == 0 || my == rows - 1) return; if (my >= 1 && my < rows - 2 && mx < cols / 2) {