mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-24 07:45:21 +00:00
Disable QuickEdit Mode when enabling mouse input for the Win32 console;
reported by "Zalapkrakna".
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
#include "pdcwin.h"
|
||||
|
||||
RCSID("$Id: pdckbd.c,v 1.110 2007/06/14 13:50:27 wmcbrine Exp $")
|
||||
RCSID("$Id: pdckbd.c,v 1.111 2007/07/22 21:48:18 wmcbrine Exp $")
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
@@ -655,7 +655,10 @@ void PDC_flushinp(void)
|
||||
|
||||
int PDC_mouse_set(void)
|
||||
{
|
||||
SetConsoleMode(pdc_con_in, SP->_trap_mbe ? ENABLE_MOUSE_INPUT : 0);
|
||||
SetConsoleMode(pdc_con_in, SP->_trap_mbe ?
|
||||
(ENABLE_MOUSE_INPUT|ENABLE_EXTENDED_FLAGS) :
|
||||
(pdc_quick_edit|ENABLE_EXTENDED_FLAGS));
|
||||
|
||||
memset(&old_mouse_status, 0, sizeof(old_mouse_status));
|
||||
|
||||
return OK;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include "pdcwin.h"
|
||||
|
||||
RCSID("$Id: pdcscrn.c,v 1.88 2007/07/03 01:51:45 wmcbrine Exp $")
|
||||
RCSID("$Id: pdcscrn.c,v 1.89 2007/07/22 21:48:18 wmcbrine Exp $")
|
||||
|
||||
#ifdef CHTYPE_LONG
|
||||
# define PDC_OFFSET 32
|
||||
@@ -28,6 +28,8 @@ unsigned char *pdc_atrtab = (unsigned char *)NULL;
|
||||
HANDLE pdc_con_out = INVALID_HANDLE_VALUE;
|
||||
HANDLE pdc_con_in = INVALID_HANDLE_VALUE;
|
||||
|
||||
DWORD pdc_quick_edit;
|
||||
|
||||
static short curstoreal[16], realtocurs[16] =
|
||||
{
|
||||
COLOR_BLACK, COLOR_BLUE, COLOR_GREEN, COLOR_CYAN, COLOR_RED,
|
||||
@@ -321,6 +323,12 @@ int PDC_scr_open(int argc, char **argv)
|
||||
GetConsoleScreenBufferInfo(pdc_con_out, &orig_scr);
|
||||
GetConsoleMode(pdc_con_in, &old_console_mode);
|
||||
|
||||
/* preserve QuickEdit Mode setting for use in PDC_mouse_set()
|
||||
when the mouse is not enabled -- other console input settings
|
||||
are cleared */
|
||||
|
||||
pdc_quick_edit = old_console_mode & ENABLE_QUICK_EDIT_MODE;
|
||||
|
||||
SP->lines = ((str = getenv("LINES")) != NULL) ?
|
||||
atoi(str) : PDC_get_rows();
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
* See the file maintain.er for details of the current maintainer. *
|
||||
************************************************************************/
|
||||
|
||||
/* $Id: pdcwin.h,v 1.4 2007/07/03 00:11:46 wmcbrine Exp $ */
|
||||
/* $Id: pdcwin.h,v 1.5 2007/07/22 21:48:18 wmcbrine Exp $ */
|
||||
|
||||
#ifdef PDC_WIDE
|
||||
# define UNICODE
|
||||
@@ -23,5 +23,6 @@
|
||||
|
||||
extern unsigned char *pdc_atrtab;
|
||||
extern HANDLE pdc_con_out, pdc_con_in;
|
||||
extern DWORD pdc_quick_edit;
|
||||
|
||||
extern int PDC_get_buffer_rows(void);
|
||||
|
||||
Reference in New Issue
Block a user