Merge pull request #16 from laelnasan/pdcurses-mouse

Pdcurses mouse
This commit is contained in:
ruki
2020-10-17 11:16:43 +08:00
committed by GitHub
3 changed files with 9 additions and 4 deletions

View File

@@ -623,7 +623,7 @@ static void register_curses_constants(lua_State *L)
CC(KEY_COPY) CC(KEY_CREATE) CC(KEY_END)
CC(KEY_EXIT) CC(KEY_FIND) CC(KEY_HELP)
CC(KEY_MARK) CC(KEY_MESSAGE)
#if !defined(XCURSES) && !defined(PDCURSES)
#if !defined(XCURSES)
#ifndef NOMOUSE
CC(KEY_MOUSE)
#endif
@@ -650,7 +650,7 @@ static void register_curses_constants(lua_State *L)
CC2(KEY_F6, KEY_F(6)) CC2(KEY_F7, KEY_F(7)) CC2(KEY_F8, KEY_F(8))
CC2(KEY_F9, KEY_F(9)) CC2(KEY_F10, KEY_F(10)) CC2(KEY_F11, KEY_F(11))
CC2(KEY_F12, KEY_F(12))
#if !defined(XCURSES) && !defined(PDCURSES)
#if !defined(XCURSES)
#ifndef NOMOUSE
/* Mouse Constants */
CC(BUTTON1_RELEASED); CC(BUTTON1_PRESSED); CC(BUTTON1_CLICKED);
@@ -763,7 +763,7 @@ LC_NUMBER2(LINES, LINES)
** mouse
** =======================================================
*/
#if !defined(XCURSES) && !defined(PDCURSES)
#if !defined(XCURSES)
#ifndef NOMOUSE
static int
lc_ungetmouse(lua_State *L)
@@ -2405,7 +2405,7 @@ static const luaL_Reg curseslib[] =
/* outopts */
{ "nl", lc_nl },
#if !defined(XCURSES) && !defined(PDCURSES)
#if !defined(XCURSES)
#ifndef NOMOUSE
{ "mousemask", lc_mousemask },
{ "mouseinterval", lc_mouseinterval},

View File

@@ -35,6 +35,9 @@ PDCurses portable platform definitions list:
#define SYSVcurses 1 /* System V Curses routines */
#define BSDcurses 1 /* BSD Curses routines */
#define CHTYPE_LONG 1 /* size of chtype; long */
#ifndef NOMOUSE
#define NCURSES_MOUSE_VERSION 2 /* Use ncurses style mouse API */
#endif
/*----------------------------------------------------------------------*/

View File

@@ -218,12 +218,14 @@ void wmouse_position(WINDOW *win, int *y, int *x)
}
}
#ifndef NCURSES_MOUSE_VERSION
unsigned long getmouse(void)
{
PDC_LOG(("getmouse() - called\n"));
return SP->_trap_mbe;
}
#endif
unsigned long getbmap(void)
{