lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev Disabling mouse in Win32 port


From: Wayne Buttles
Subject: lynx-dev Disabling mouse in Win32 port
Date: Sun, 14 Jun 1998 16:44:52 -0400 (EDT)

Previously, there was no way to disable the mouse in the pcdurses version
of the win32 port.  Even before I had cobbled in the mouse support,
borland had a mouse cursor enabled during lynx and clicking would set off
a false keyclick.  Because of this, I decided the best thing to do would
be to tell the borland library to completely disable the mouse unless it
was requested with -use_mouse.  I couldn't decide on a good ifdef variable
to use so I left it with __BORLANDC__.  If someone has a better
suggestion, please mention it.


*** LYCurses.old        Thu May 14 08:01:12 1998
--- LYCurses.c  Sun Jun 14 16:01:34 1998
***************
*** 847,852 ****
--- 847,864 ----
  
  PUBLIC void lynx_enable_mouse ARGS1(int,state)
  {
+ 
+ #ifdef __BORLANDC__
+ HANDLE hConIn = INVALID_HANDLE_VALUE;
+ hConIn = GetStdHandle(STD_INPUT_HANDLE);
+ if (LYUseMouse == 0)
+ {
+       SetConsoleMode(hConIn, ENABLE_WINDOW_INPUT);
+       FlushConsoleInputBuffer(hConIn);
+       return;
+ }
+ #endif
+ 
         if (LYUseMouse == 0)
        return;
  
***************
*** 857,871 ****
  #ifdef NCURSES_MOUSE_VERSION
      /* Inform ncurses that we're interested in knowing when mouse
       * button 1 is clicked */
! #ifndef _WINDOWS
      if (state)
        mousemask(BUTTON1_CLICKED | BUTTON3_CLICKED, NULL);
      else
        mousemask(0, NULL);
  #else
      if (state)
!       mouse_set(BUTTON1_CLICKED && BUTTON2_CLICKED && BUTTON3_CLICKED);
! #endif /* !_WINDOWS */
  #endif /* NCURSES_MOUSE_VERSION */
  
  #if defined(DJGPP) && !defined(USE_SLANG)
--- 869,887 ----
  #ifdef NCURSES_MOUSE_VERSION
         /* Inform ncurses that we're interested in knowing when mouse
          * button 1 is clicked */
! #ifndef __BORLANDC__
         if (state)
        mousemask(BUTTON1_CLICKED | BUTTON3_CLICKED, NULL);
         else
        mousemask(0, NULL);
  #else
         if (state)
!        {
!       SetConsoleMode(hConIn, ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT);
!       FlushConsoleInputBuffer(hConIn);
! /*    mouse_set(BUTTON1_CLICKED && BUTTON2_CLICKED && BUTTON3_CLICKED); */
!       }
! #endif /* !__BORLANDC__ */
  #endif /* NCURSES_MOUSE_VERSION */
  
  #if defined(DJGPP) && !defined(USE_SLANG)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]