diff --git a/src/uifc/uifc.h b/src/uifc/uifc.h index a0c9ec6e32c9dc810727fd14a70423461d492d88..2e317d4a0021e12222111693fdb7bc3e6d367248 100644 --- a/src/uifc/uifc.h +++ b/src/uifc/uifc.h @@ -191,6 +191,8 @@ * Return value is -2 - keyvalue */ #define WIN_NOBRDR (1<<24) /* Do not draw a border around the window */ #define WIN_FIXEDHEIGHT (1<<25) /* Use list_height from uifc struct */ +#define WIN_UNGETMOUSE (1<<26) /* If the mouse is clicked outside the window, */ + /* Put the mouse event back into the event queue */ #define WIN_MID WIN_L2R|WIN_T2B /* Place window in middle of screen */ @@ -213,8 +215,8 @@ #define K_SCANNING (1L<<11) /* UPC Scanner is active... return on '%' */ #define K_TABEXIT (1L<<12) /* Return on TAB or BACKTAB */ #define K_DECIMAL (1L<<13) /* Allow floating point numbers only */ -#define K_DEUCEEXIT (1L<<13) /* Return whenever Deuce wants to exit */ - /* Define this behaviour better - ToDo */ +#define K_DEUCEEXIT (1L<<14) /* Return whenever Deuce wants to exit */ + /* Returns on up/down/F2 */ #define HELPBUF_SIZE 4000 diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c index 6d13a266d22443b9add5b232bcf0e67226156d13..c27f48789c513d924eb74e03a09377c3af892a47 100644 --- a/src/uifc/uifc32.c +++ b/src/uifc/uifc32.c @@ -957,8 +957,14 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar || mevnt.starty<s_top+top || mevnt.starty>s_top+top+height-1) && (mevnt.event==CIOLIB_BUTTON_1_CLICK - || mevnt.event==CIOLIB_BUTTON_3_CLICK)) - i=ESC; + || mevnt.event==CIOLIB_BUTTON_3_CLICK)) { + if(mode&WIN_UNGETMOUSE) { + ungetmouse(mevnt); + } + else { + i=ESC; + } + } } } /* For compatibility with terminals lacking special keys */