wmcbrine / PDCurses

A curses library for environments that don't fit the termcap/terminfo model.
https://pdcurses.org/
1.03k stars 171 forks source link

Meaning of PDC_MOUSE_POSITION/MOUSE_POS_REPORT ? #129

Open Bill-Gray opened 2 years ago

Bill-Gray commented 2 years ago

We have flags/#defines for reporting mouse movement (PDC_MOUSE_MOVED, MOUSE_MOVED). And we have flags and #defines for 'reporting mouse position' (PDC_MOUSE_POSITION, MOUSE_POS_REPORT).

It would appear that the latter get exactly zero use, including in a spot-check of older versions of PDCurses. As best I can tell, they could be marked as "don't bother using these; they don't actually do anything".

Is this some sort of historical remnant? Or something that had a planned use that never happened, or...?

wmcbrine commented 2 years ago

Good question. Might ask @rexx-org. But it looks like they would be used to report mouse movements without any buttons held down, if that were implemented.

Bill-Gray commented 2 years ago

Thank you. I've always assumed that PDC_MOUSE_MOVED and MOUSE_MOVED were reserved for reporting button-less mouse movements. That's the way it works in ncurses (on the platforms that support such movements at all), and it's how I've implemented mouse movements in my fork.

Maybe there was some intended use for PDC_MOUSE_POSITION and MOUSE_POS_REPORT. Right now, though, there's some risk of somebody using them thinking they'll actually do something. (That "someone" nearly being me recently.)