-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Unable to get mouse position when hovering #154
Comments
You also have to set the It may also be worth trying the SDL1 or SDL2 platform. I have a vague memory that mouse movements were not supported in WinCon unless you had a button pressed (an issue that apparently neither I nor William was able to work around). If your program works on SDL2 but not with WinCon, that'd be a significant clue. |
Exactly!
I tried SDL, same thing... but! finally I found where the issue is and made a fix: for (i = 0; i < 3; i++)
{
if (old_mouse_status.button[i] != SP->mouse_status.button[i])
SP->mouse_status.changes |= (1 << i);
/* Discard non-moved "moves" */
if (SP->mouse_status.x == old_mouse_status.x &&
SP->mouse_status.y == old_mouse_status.y)
continue;
/* Motion events always flag the button as changed */
SP->mouse_status.changes |= (1 << i);
SP->mouse_status.changes |= PDC_MOUSE_MOVED;
SP->mouse_status.button[i] = BUTTON_MOVED; // <--- to report same value as ncurses when hovering
break;
} So... from what i understand: It appears that the buttons are never set to the Regarding this fix, although everything appears to work fine, when using the (Here's the minimal example I used to test both pdcurses and ncurses)
|
Ok, a condition like |
Ah... the fix, actually doesn't work us expected... and without |
If i won't change the code besides this line to |
Another Failed (but closer to the solution) fix for (i = 0; i < 3; i++)
{
if (old_mouse_status.button[i] != SP->mouse_status.button[i])
SP->mouse_status.changes |= (1 << i);
if (action == BUTTON_MOVED)
{
/* Discard non-moved "moves" */
if (SP->mouse_status.x == old_mouse_status.x &&
SP->mouse_status.y == old_mouse_status.y)
return -1;
/* Motion events always flag the button as changed */
SP->mouse_status.changes |= (1 << i);
SP->mouse_status.changes |= PDC_MOUSE_MOVED;
SP->mouse_status.button[i] = BUTTON_MOVED;
break;
}
} Now the issue with this is, is that whenever i move the mouse and right click, it adds a release too or something |
Althought I'm able to get an
MEVENT
when clicking or scrolling (on a windows terminal), I'm unable when just hovering\moving my mouse around, any idea why?wgetch
doesn't return anything... and it baffles me a while now... I've looked into the source code but i couldn't figure out if i did something wrong or there is any issueThe text was updated successfully, but these errors were encountered: