lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev MINGW port of lynx (long) [PATCH]


From: Doug Kaufman
Subject: Re: lynx-dev MINGW port of lynx (long) [PATCH]
Date: Sun, 14 Sep 2003 01:03:00 -0700 (PDT)

On Sun, 7 Sep 2003, I wrote:

> The SLang version seems to work fine, but you can't do COLOR_STYLE
> with SLang (or at least I couldn't design a patch for it to work). In
> the PDCurses version, the arrow keys only work properly with NUMLOCK
> off. I couldn't figure out how to fix this, but it seems to be a
> PDCurses problem, since the same applies to the option screen of
> "testcurs.exe" in the PDCurses distribution. See comments at the end of
> this message.
> ... 
> The problem with the arrow keys under PDCurses is that when NUMLOCK
> is on, the arrow keystrokes seem to be queued. If you then turn off
> NUMLOCK and press an arrow key, all of the previous keypresses will
> be executed, in addition to the current one. I would appreciate any
> insight into this behavior. When NUMLOCK is on, holding down an arrow
> key leads to execution of multiple instances of the key after a delay
> of about half a second, but it is difficult to control.

Well, I kept working at this and found a solution to let the arrow
keys work in the PDCurses/Mingw port. I am appending a patch for
pdcurses 2.6 which seems to fix the problem. My copy of lynx compiled
with this patch seems to work well, as does the testcurs program in
pdcurses. The problem seems to be that with NUMLOCK on, the arrow keys
send two sequential keycodes. The first is for the arrow key itself
and the second is wVirtualKeyCode=16 with dwControlKeyState=0x120. The
distributed PDCurses code doesn't refresh if there is input pending,
so the second keycode (which is thrown away) prevents the refresh. I
also included in the patch a change to the cursor code so that it
actually gives an underline cursor when it claims to (at least on my
machine).

It looks like my analysis of the problem was wrong in my earlier post.
The keystrokes were not queued. The were actually executed, but the
display was not updated to reflect the new position of the cursor.

Please test this and see if there are any other problems with the SLang
or PDCurses mingw ports.
                        Doug


--- pdcurses/refresh.c.ori      2002-12-15 21:58:28.000000000 -0800
+++ pdcurses/refresh.c  2003-09-13 23:16:36.000000000 -0700
@@ -293,12 +293,14 @@
 
 /* if checking for typeahead, bail out here if any is found */
    
+#ifndef __MINGW32__
    if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) 
    {
       rc = PDC_breakout();
       if(rc)
          return( OK );
    }
+#endif /* __MINGW32__ */
 
    if (curscr->_clear)
       PDC_clr_update(curscr);
--- win32/pdckbd.c.ori  2002-12-17 02:18:34.000000000 -0800
+++ win32/pdckbd.c      2003-09-14 00:21:18.000000000 -0700
@@ -518,7 +518,7 @@
             switch(save_ip.Event.KeyEvent.wVirtualKeyCode)
             {
                case 16: /* shift */
-                  if ( SP->return_key_modifiers ) return KEY_SHIFT_R;
+                  if ( SP->return_key_modifiers & SHIFT_PRESSED) return 
KEY_SHIFT_R;
                   ignore_key = 1;
                   break;
                case 17: /* control */
--- win32/pdcdisp.c.ori 2001-01-09 23:30:48.000000000 -0800
+++ win32/pdcdisp.c     2003-09-13 23:07:44.000000000 -0700
@@ -476,12 +476,14 @@
    curscr->_firstch[lineno] = _NO_CHANGE;
    curscr->_lastch[lineno] = _NO_CHANGE;
    
+#ifndef __MINGW32__
    if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) 
    {
       rc = PDC_breakout();
       if (rc)
          return(TRUE);
    }
+#endif /* __MINGW32__ */
    return(FALSE);
 }
 
--- win32/pdcsetsc.c.ori        2001-01-09 23:30:54.000000000 -0800
+++ win32/pdcsetsc.c    2003-09-13 23:34:52.000000000 -0700
@@ -220,11 +220,11 @@
                        break;
                case 2:                 /* highly visible */
                        cci.bVisible = TRUE;
-                       cci.dwSize = 95;
+                       cci.dwSize = 50;
                        break;
                default:                /* normal visibility */
                        cci.bVisible = TRUE;
-                       cci.dwSize = 25;
+                       cci.dwSize = 15;
                        break;
        }
 

-- 
Doug Kaufman
Internet: address@hidden


; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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