texinfo-commits
[Top][All Lists]
Advanced

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

[7650] windows input


From: gavinsmith0123
Subject: [7650] windows input
Date: Sun, 29 Jan 2017 07:44:56 -0500 (EST)

Revision: 7650
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7650
Author:   gavin
Date:     2017-01-29 07:44:55 -0500 (Sun, 29 Jan 2017)
Log Message:
-----------
windows input

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/echo-area.c
    trunk/info/pcterm.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2017-01-23 20:48:49 UTC (rev 7649)
+++ trunk/ChangeLog     2017-01-29 12:44:55 UTC (rev 7650)
@@ -1,3 +1,17 @@
+2017-01-29  Jason Hood  <address@hidden>
+
+       * info/echo-area.c (pause_or_input) [__MINGW32__]: Add an 
+       working implementation of this function, allowing echo area 
+       messages to be seen.
+       * info/pcterm.c (gettextinfo):  Windows 10 can now apparently 
+       seek console input, so just use GetConsoleMode to determine 
+       that.
+       (pc_initialize_terminal) [_WIN32]: Sets the 'term_??'
+       definitions for KEY_HOME, KEY_END (and KEY_INSERT), allowing 
+       Home and End to be used in the echo area (rather than having to
+       explicitly define 'M-<' and 'M->').
+       (w32_our_tty): Shorten function.
+
 2017-01-23  Gavin Smith  <address@hidden>
 
        * info/info-utils.c (scan_node_contents): Use 'strncmp' instead 

Modified: trunk/info/echo-area.c
===================================================================
--- trunk/info/echo-area.c      2017-01-23 20:48:49 UTC (rev 7649)
+++ trunk/info/echo-area.c      2017-01-29 12:44:55 UTC (rev 7650)
@@ -1525,6 +1525,11 @@
 #  define HAVE_STRUCT_TIMEVAL
 #endif /* HAVE_SYS_TIME_H */
 
+#if !defined (FD_SET) && defined (__MINGW32__)
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+#endif
+
 static void
 pause_or_input (void)
 {
@@ -1537,6 +1542,11 @@
   timer.tv_sec = 2;
   timer.tv_usec = 0;
   select (fileno (stdin) + 1, &readfds, NULL, NULL, &timer);
+#elif defined (__MINGW32__)
+  /* This is signalled on key release, so flush it and wait again. */
+  WaitForSingleObject (GetStdHandle (STD_INPUT_HANDLE), 2000);
+  FlushConsoleInputBuffer (GetStdHandle (STD_INPUT_HANDLE));
+  WaitForSingleObject (GetStdHandle (STD_INPUT_HANDLE), 2000);
 #endif /* FD_SET */
 }
 

Modified: trunk/info/pcterm.c
===================================================================
--- trunk/info/pcterm.c 2017-01-23 20:48:49 UTC (rev 7649)
+++ trunk/info/pcterm.c 2017-01-29 12:44:55 UTC (rev 7650)
@@ -174,10 +174,11 @@
   hstdin = GetStdHandle (STD_INPUT_HANDLE);
   hstdout = GetStdHandle (STD_OUTPUT_HANDLE);
 
-  if (hstdin != INVALID_HANDLE_VALUE
-      && hstdout != INVALID_HANDLE_VALUE
-      && GetConsoleMode (hstdout, &ignored)
-      && GetConsoleMode (hstdin, &old_inpmode))
+  if (!GetConsoleMode (hstdin, &ignored))
+    hstdin = INVALID_HANDLE_VALUE;
+
+  if (hstdout != INVALID_HANDLE_VALUE
+      && GetConsoleMode (hstdout, &ignored))
     {
       hinfo = CreateConsoleScreenBuffer (GENERIC_READ | GENERIC_WRITE,
                                         FILE_SHARE_READ | FILE_SHARE_WRITE,
@@ -486,15 +487,9 @@
 static int
 w32_our_tty (int fd)
 {
-  return
-    isatty (fd)
-   /* Windows `isatty' actually tests for character devices, so the
-     null device gets reported as a tty.  Fix that by calling
-     `lseek'.  */
-    && lseek (fd, SEEK_CUR, 0) == -1
-    /* Is this our tty?  */
-    && hstdin != INVALID_HANDLE_VALUE
-    && hstdin == (HANDLE)_get_osfhandle (fd);
+  /* Is this our tty?  */
+  return hstdin != INVALID_HANDLE_VALUE
+        && hstdin == (HANDLE)_get_osfhandle (fd);
 }
 
 /* Translate a Windows key event into the equivalent sequence of bytes
@@ -1211,6 +1206,10 @@
   term_ke = (char *)find_sequence (K_End);
   term_ki = (char *)find_sequence (K_Insert);
   term_kD = (char *)find_sequence (K_Delete);
+#elif defined _WIN32
+  term_kh = "\033<";
+  term_ke = "\033>";
+  term_ki = "\033[L";
 #endif /* __MSDOS__ */
 
   /* Set all the hooks to our PC-specific functions.  */




reply via email to

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