bug-texinfo
[Top][All Lists]
Advanced

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

Re: mouse support in the Info reader (was: newer info reader does not al


From: Eli Zaretskii
Subject: Re: mouse support in the Info reader (was: newer info reader does not allow text selection per mouse)
Date: Mon, 06 Apr 2015 16:54:33 +0300

> Date: Mon, 6 Apr 2015 13:34:10 +0100
> From: Gavin Smith <address@hidden>
> Cc: Texinfo <address@hidden>
> 
> This is due to capturing mouse events to allow a mouse scrollwheel to
> scroll a node. In xterm and probably other terminal emulators as well
> you can select text with the shift key plus click and drag.

I didn't know about this support, so the MS-Windows port doesn't have
it.  The changes below introduce mouse wheel support on Windows as
well; OK to commit?

> Maybe we should add a note to the manual about this.

Definitely.

Index: ChangeLog
===================================================================
--- ChangeLog   (revision 6203)
+++ ChangeLog   (working copy)
@@ -1,3 +1,9 @@
+2015-04-06  Eli Zaretskii  <address@hidden>
+
+       * info/pcterm.c (w32_info_prep): Enable mouse input.
+       (w32_kbd_read): Support mouse wheel events by scrolling display
+       like mouse_event_handler does.
+
 2015-04-06  Gavin Smith  <address@hidden>
 
        * doc/texinfo.texi (Invoking install-info): Include ellipsis 

Index: info/pcterm.c
===================================================================
--- info/pcterm.c       (revision 6203)
+++ info/pcterm.c       (working copy)
@@ -111,7 +111,7 @@
       SetConsoleActiveScreenBuffer (hinfo);
       current_attr = norm_attr;
       hscreen = hinfo;
-      SetConsoleMode (hstdin, ENABLE_WINDOW_INPUT);
+      SetConsoleMode (hstdin, ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT);
       GetConsoleMode (hscreen, &old_outpmode);
       SetConsoleMode (hscreen, old_outpmode & ~ENABLE_WRAP_AT_EOL_OUTPUT);
     }
@@ -641,6 +641,28 @@
                    redisplay_after_signal ();
                  }
                  break;
+               case MOUSE_EVENT:
+                 {
+                   /* Only vertical wheel support for now.  */
+                   int wheeled =
+                     (inrec.Event.MouseEvent.dwEventFlags & MOUSE_WHEELED) != 
0;
+                   if (wheeled && mouse_protocol == MP_NORMAL_TRACKING)
+                     {
+                       extern void info_up_line (WINDOW *, int count);
+                       extern void info_down_line (WINDOW *, int count);
+                       extern WINDOW *active_window;
+
+                       int hiword =
+                         HIWORD (inrec.Event.MouseEvent.dwButtonState);
+
+                       if ((hiword & 0xFF00) == 0)
+                         info_up_line (active_window, 3);
+                       else
+                         info_down_line (active_window, 3);
+                       display_update_display ();
+                     }
+                 }
+                 break;
                default:
                  break;
              }



reply via email to

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