From dd84326ae32be1f0016fc833d99569bc1b8bcd9b Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sat, 11 Nov 2006 17:49:48 +0000 Subject: [PATCH] Call PDC_mouse_set() when the mouse mask is changed. Currently, the only effect is that the mouse cursor no longer appears in full-screen mode in Win32 unless the mask is nonzero. --- curspriv.h | 3 ++- dos/pdckbd.c | 6 +++++- os2/pdckbd.c | 6 +++++- pdcurses/mouse.c | 11 +++++++---- win32/pdckbd.c | 7 ++++++- win32/pdcscrn.c | 4 ++-- x11/pdckbd.c | 6 +++++- 7 files changed, 32 insertions(+), 11 deletions(-) diff --git a/curspriv.h b/curspriv.h index 4e931691..6d1b2f5a 100644 --- a/curspriv.h +++ b/curspriv.h @@ -11,7 +11,7 @@ * See the file maintain.er for details of the current maintainer. * ************************************************************************/ -/* $Id: curspriv.h,v 1.137 2006/11/11 16:36:07 wmcbrine Exp $ */ +/* $Id: curspriv.h,v 1.138 2006/11/11 17:49:48 wmcbrine Exp $ */ /* CURSPRIV.H @@ -80,6 +80,7 @@ int PDC_get_rows(void); void PDC_gotoyx(int, int); void PDC_init_atrtab(void); int PDC_init_color(short, short, short, short); +void PDC_mouse_set(void); void PDC_napms(int); void PDC_reset_prog_mode(void); void PDC_reset_shell_mode(void); diff --git a/dos/pdckbd.c b/dos/pdckbd.c index 4a874e2e..e89a18fd 100644 --- a/dos/pdckbd.c +++ b/dos/pdckbd.c @@ -19,7 +19,7 @@ #include "pdcdos.h" -RCSID("$Id: pdckbd.c,v 1.45 2006/10/28 13:22:02 wmcbrine Exp $"); +RCSID("$Id: pdckbd.c,v 1.46 2006/11/11 17:49:48 wmcbrine Exp $"); /************************************************************************ * Table for key code translation of function keys in keypad mode * @@ -411,3 +411,7 @@ void PDC_flushinp(void) setdosmemword(0x41a, getdosmemword(0x41c)); } + +void PDC_mouse_set(void) +{ +} diff --git a/os2/pdckbd.c b/os2/pdckbd.c index 6bb5b4bd..cd7aa44c 100644 --- a/os2/pdckbd.c +++ b/os2/pdckbd.c @@ -30,7 +30,7 @@ static int tahead = -1; static KBDINFO kbdinfo; /* default keyboard mode */ #endif -RCSID("$Id: pdckbd.c,v 1.44 2006/10/28 13:22:02 wmcbrine Exp $"); +RCSID("$Id: pdckbd.c,v 1.45 2006/11/11 17:49:48 wmcbrine Exp $"); /************************************************************************ * Table for key code translation of function keys in keypad mode * @@ -517,3 +517,7 @@ void PDC_flushinp(void) KbdFlushBuffer(0); #endif } + +void PDC_mouse_set(void) +{ +} diff --git a/pdcurses/mouse.c b/pdcurses/mouse.c index 749ad2de..0ef5c54b 100644 --- a/pdcurses/mouse.c +++ b/pdcurses/mouse.c @@ -14,7 +14,7 @@ #include #include -RCSID("$Id: mouse.c,v 1.27 2006/11/05 03:57:26 wmcbrine Exp $"); +RCSID("$Id: mouse.c,v 1.28 2006/11/11 17:49:48 wmcbrine Exp $"); /*man-start************************************************************** @@ -32,8 +32,8 @@ RCSID("$Id: mouse.c,v 1.27 2006/11/05 03:57:26 wmcbrine Exp $"); unsigned long getbmap(void); PDCurses Description: - ALL DESCRIPTIONS ARE GUESSES. I DON'T KNOW ANYONE WHO KNOWS - EXACTLY WHAT THESE FUNCTIONS DO! + These functions are intended to be based on Sys V mouse + functions; however, those are undocumented. The mouse_set(), mouse_on() and mouse_off() functions are analagous to the attrset(), attron() and attroff() functions. @@ -59,7 +59,7 @@ RCSID("$Id: mouse.c,v 1.27 2006/11/05 03:57:26 wmcbrine Exp $"); y and x. The getmouse() function returns the current status of the trapped - mouse buttons as set by mouse_set(), mouse_on(); + mouse buttons as set by mouse_set() or mouse_on(). The getbmap() function returns the current status of the button action used to map a mouse action to the Soft Label Keys as set @@ -85,6 +85,7 @@ int mouse_set(unsigned long mbe) PDC_LOG(("mouse_set() - called: event %x\n", mbe)); SP->_trap_mbe = mbe; + PDC_mouse_set(); return OK; } @@ -94,6 +95,7 @@ int mouse_on(unsigned long mbe) PDC_LOG(("mouse_on() - called: event %x\n", mbe)); SP->_trap_mbe |= mbe; + PDC_mouse_set(); return OK; } @@ -103,6 +105,7 @@ int mouse_off(unsigned long mbe) PDC_LOG(("mouse_off() - called: event %x\n", mbe)); SP->_trap_mbe &= ~mbe; + PDC_mouse_set(); return OK; } diff --git a/win32/pdckbd.c b/win32/pdckbd.c index 924f9c04..6bb24586 100644 --- a/win32/pdckbd.c +++ b/win32/pdckbd.c @@ -13,7 +13,7 @@ #include "pdcwin.h" -RCSID("$Id: pdckbd.c,v 1.71 2006/10/28 13:22:02 wmcbrine Exp $"); +RCSID("$Id: pdckbd.c,v 1.72 2006/11/11 17:49:48 wmcbrine Exp $"); #define ACTUAL_MOUSE_MOVED (actual_mouse_status.changes & 8) #define ACTUAL_BUTTON_STATUS(x) (actual_mouse_status.button[(x) - 1]) @@ -1046,3 +1046,8 @@ void PDC_flushinp(void) FlushConsoleInputBuffer(pdc_con_in); } + +void PDC_mouse_set(void) +{ + SetConsoleMode(pdc_con_in, (SP->_trap_mbe ? ENABLE_MOUSE_INPUT : 0)); +} diff --git a/win32/pdcscrn.c b/win32/pdcscrn.c index f19bfd42..5c767646 100644 --- a/win32/pdcscrn.c +++ b/win32/pdcscrn.c @@ -13,7 +13,7 @@ #include "pdcwin.h" -RCSID("$Id: pdcscrn.c,v 1.70 2006/11/11 16:36:08 wmcbrine Exp $"); +RCSID("$Id: pdcscrn.c,v 1.71 2006/11/11 17:49:48 wmcbrine Exp $"); #define PDC_RESTORE_NONE 0 #define PDC_RESTORE_BUFFER 1 @@ -557,7 +557,7 @@ void PDC_reset_prog_mode(void) { PDC_LOG(("PDC_reset_prog_mode() - called.\n")); - SetConsoleMode(pdc_con_in, ENABLE_MOUSE_INPUT); + PDC_mouse_set(); } void PDC_reset_shell_mode(void) diff --git a/x11/pdckbd.c b/x11/pdckbd.c index 907ebcbc..a10941da 100644 --- a/x11/pdckbd.c +++ b/x11/pdckbd.c @@ -13,7 +13,7 @@ #include "pdcx11.h" -RCSID("$Id: pdckbd.c,v 1.45 2006/10/28 13:22:03 wmcbrine Exp $"); +RCSID("$Id: pdckbd.c,v 1.46 2006/11/11 17:49:48 wmcbrine Exp $"); #define TRAPPED_MOUSE_X_POS (pdc_mouse_status.x) #define TRAPPED_MOUSE_Y_POS (pdc_mouse_status.y) @@ -209,3 +209,7 @@ void PDC_flushinp(void) while (PDC_check_bios_key()) PDC_get_bios_key(); } + +void PDC_mouse_set(void) +{ +}