diff --git a/curses.h b/curses.h index 10ffe884..a615ca36 100644 --- a/curses.h +++ b/curses.h @@ -16,8 +16,8 @@ PDCurses definitions list: (Only define those needed) (Red = 1, Green = 2, Blue = 4) instead of BGR. PDC_WIDE True if building wide-character support. PDC_DLL_BUILD True if building a Windows DLL. - NCURSES_MOUSE_VERSION Use the ncurses mouse API instead - of PDCurses' traditional mouse API. + PDC_NCMOUSE Use the ncurses mouse API instead + of PDCurses' traditional mouse API. PDCurses portable platform definitions list: @@ -216,6 +216,10 @@ typedef struct in the same format as used for mousemask() */ } MEVENT; +#if defined(PDC_NCMOUSE) && !defined(NCURSES_MOUSE_VERSION) +# define NCURSES_MOUSE_VERSION 2 +#endif + #ifdef NCURSES_MOUSE_VERSION # define BUTTON_SHIFT BUTTON_MODIFIER_SHIFT # define BUTTON_CONTROL BUTTON_MODIFIER_CONTROL diff --git a/man/MANUAL.md b/man/MANUAL.md index ef78ade2..cdaf0fa9 100644 --- a/man/MANUAL.md +++ b/man/MANUAL.md @@ -8,8 +8,8 @@ PDCurses definitions list: (Only define those needed) (Red = 1, Green = 2, Blue = 4) instead of BGR. PDC_WIDE True if building wide-character support. PDC_DLL_BUILD True if building a Windows DLL. - NCURSES_MOUSE_VERSION Use the ncurses mouse API instead - of PDCurses' traditional mouse API. + PDC_NCMOUSE Use the ncurses mouse API instead + of PDCurses' traditional mouse API. PDCurses portable platform definitions list: @@ -1782,11 +1782,11 @@ mouse nc_getmouse() returns the current mouse status in an MEVENT struct. This is equivalent to ncurses' getmouse(), renamed to avoid conflict with PDCurses' getmouse(). But if you define - NCURSES_MOUSE_VERSION (preferably as 2) before including - curses.h, it defines getmouse() to nc_getmouse(), along with a - few other redefintions needed for compatibility with ncurses - code. nc_getmouse() calls request_mouse_pos(), which (not - getmouse()) is the classic equivalent. + PDC_NCMOUSE before including curses.h, it defines getmouse() to + nc_getmouse(), along with a few other redefintions needed for + compatibility with ncurses code. nc_getmouse() calls + request_mouse_pos(), which (not getmouse()) is the classic + equivalent. ungetmouse() is the mouse equivalent of ungetch(). However, PDCurses doesn't maintain a queue of mouse events; only one can diff --git a/pdcurses/mouse.c b/pdcurses/mouse.c index ca04c9be..a6acec9a 100644 --- a/pdcurses/mouse.c +++ b/pdcurses/mouse.c @@ -120,11 +120,11 @@ mouse nc_getmouse() returns the current mouse status in an MEVENT struct. This is equivalent to ncurses' getmouse(), renamed to avoid conflict with PDCurses' getmouse(). But if you define - NCURSES_MOUSE_VERSION (preferably as 2) before including - curses.h, it defines getmouse() to nc_getmouse(), along with a - few other redefintions needed for compatibility with ncurses - code. nc_getmouse() calls request_mouse_pos(), which (not - getmouse()) is the classic equivalent. + PDC_NCMOUSE before including curses.h, it defines getmouse() to + nc_getmouse(), along with a few other redefintions needed for + compatibility with ncurses code. nc_getmouse() calls + request_mouse_pos(), which (not getmouse()) is the classic + equivalent. ungetmouse() is the mouse equivalent of ungetch(). However, PDCurses doesn't maintain a queue of mouse events; only one can