Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Corinna Vinschen
On Aug 19 13:08, Charles Wilson wrote:
 Corinna Vinschen wrote:
 OTOH, if you have an idea how to solve the ALT + Cursor key problem
 
 No, nothing obvious. I'd just turn on some of the debugging in the main 
 loop and see what happens to the keystrokes.

Got it.  The Alt key is handled rather strange in Windows.  For some
reason, some of the Alt-key combinations generate a WM_SYSCHAR message,
while other Alt-key combinations (Alt-Cursor, Alt-Fkey, etc) generate a
WM_SYSKEYDOWN message only. 

rxvt already handles *one* *single* *key* *combination* specially,
Alt-F10.  I have no idea what's so special with Alt-F10, but there you
are.  This special handling is not necessary, it even looks a bit wrong.

The patch to get all missing Alt-key combinations working is quite
simple:

--- W11/w32/event.c.ORIG2007-08-20 12:56:25.637210400 +0200
+++ W11/w32/event.c 2007-08-20 13:09:55.322732400 +0200
@@ -127,11 +127,6 @@ doTranslateMessage(MSG *m)
((m-wParam == VK_BACK) ||
 (((m-wParam == VK_ADD) || (m-wParam == VK_SUBTRACT)) 
  (GetKeyState(VK_SHIFT)  0x8000 return;
-   if ((m-message == WM_SYSKEYDOWN)  (m-wParam == VK_F10))
-   {
-   m-message = WM_KEYDOWN;
-   return;
-   }
TranslateMessage(m);
 }
 
@@ -205,7 +200,8 @@ LONG NT_handleMsg(
case WM_QUIT:
case WM_CLOSE:
case WM_DESTROY:
-   case WM_SYSCHAR:/* alt-keys go here */
+   case WM_SYSKEYDOWN: /* Some alt-keys go here */
+   case WM_SYSCHAR:/* Other alt-keys go here */
case WM_CHAR:
case WM_LBUTTONDBLCLK:
case WM_MBUTTONDBLCLK:
@@ -543,6 +539,7 @@ WinEventToXEvent(
}
event-xkey.window=(Window)window;
break;
+   case WM_SYSKEYDOWN:
case WM_KEYDOWN:
event-type=KeyPress;
switch (wParam)

This works fine for me.  All other, already working Alt-key combinations
still work, plus the new Alt-Cursor, Alt_Fkey, etc.  Even Alt-F10 works
as before.  I'm going to use this patch locally anyway, but maybe that's
one for inclusion upstream?


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Brian Dessent
Corinna Vinschen wrote:

 as before.  I'm going to use this patch locally anyway, but maybe that's
 one for inclusion upstream?

As far as I know, there is no upstream rxvt -- it's a dead project.  The
rxvt-unicode fork is where new development happens.  I'm not sure what
that means exactly for the W11/Win32 parts of rxvt.  I'm sure Chuck
could answer this a lot more definitively.

Brian


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Corinna Vinschen
On Aug 20 04:25, Brian Dessent wrote:
 Corinna Vinschen wrote:
 
  as before.  I'm going to use this patch locally anyway, but maybe that's
  one for inclusion upstream?
 
 As far as I know, there is no upstream rxvt -- it's a dead project.  The
 rxvt-unicode fork is where new development happens.  I'm not sure what
 that means exactly for the W11/Win32 parts of rxvt.  I'm sure Chuck
 could answer this a lot more definitively.

It makes still sense for Cygwin, isn't it?


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Corinna Vinschen
On Aug 20 13:59, Corinna Vinschen wrote:
 On Aug 20 04:25, Brian Dessent wrote:
  Corinna Vinschen wrote:
  
   as before.  I'm going to use this patch locally anyway, but maybe that's
   one for inclusion upstream?
  
  As far as I know, there is no upstream rxvt -- it's a dead project.  The
  rxvt-unicode fork is where new development happens.  I'm not sure what
  that means exactly for the W11/Win32 parts of rxvt.  I'm sure Chuck
  could answer this a lot more definitively.
 
 It makes still sense for Cygwin, isn't it?

I'm just a bit puzzled about the key codes.  By default, when rxvt is
invoked without explicitely setting the terminal name (-tn option),
rxvt is recognized as an xterm.  The cursor keys correctly return
ESC [ A to ESC [ D.  However, the Home and End keys return ESC [ 7 ~
and ESC [ 8 ~, while a real xterm returns ESC [ H and ESC [ F.

Ok, so I set the terminal to rxvt-cygwin-native as suggested in the
README file.

Now the Home and End keys are ok, because the termcap/terminfo entry
for these keys is matching.  However, the termcap/terminfo entries
expect ESC O A to ESC O D for the cursor keys but, as I wrote above,
rxvt returns the xterm sequences ESC [ A to ESC [ D, so the cursor
keys don't work anymore.

So the question is, how is that supposed to work?  Wouldn't it make
sense to change the escape sequences of Home and End key to their xterm
equivalents and drop the idea to set TERM to rxvt-cygwin-native?
At least this looks like the simpler approach, rather than changing
the termcap/terminfo entries of the world...


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Corinna Vinschen
On Aug 20 16:06, Corinna Vinschen wrote:
 I'm just a bit puzzled about the key codes.  By default, when rxvt is
 invoked without explicitely setting the terminal name (-tn option),
 rxvt is recognized as an xterm.  The cursor keys correctly return
 ESC [ A to ESC [ D.  However, the Home and End keys return ESC [ 7 ~
 and ESC [ 8 ~, while a real xterm returns ESC [ H and ESC [ F.
 
 Ok, so I set the terminal to rxvt-cygwin-native as suggested in the
 README file.
 
 Now the Home and End keys are ok, because the termcap/terminfo entry
 for these keys is matching.  However, the termcap/terminfo entries
 expect ESC O A to ESC O D for the cursor keys but, as I wrote above,
 rxvt returns the xterm sequences ESC [ A to ESC [ D, so the cursor
 keys don't work anymore.

On further looking into this, it appears that the termcap/terminfo
entries are wrong.  ESC O A to ESC O D are only generated after
entering the DEC expanded cursor mode with ESC [ ? 1 h.  The default
codes are ESC [ A to ESC [ D.  It's not clear to me why the
termcap/terminfo entries list the expanded mode sequences instead of
the standard sequences.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Corinna Vinschen
On Aug 20 16:44, Corinna Vinschen wrote:
 On Aug 20 16:06, Corinna Vinschen wrote:
  I'm just a bit puzzled about the key codes.  By default, when rxvt is
  invoked without explicitely setting the terminal name (-tn option),
  rxvt is recognized as an xterm.  The cursor keys correctly return
  ESC [ A to ESC [ D.  However, the Home and End keys return ESC [ 7 ~
  and ESC [ 8 ~, while a real xterm returns ESC [ H and ESC [ F.
  
  Ok, so I set the terminal to rxvt-cygwin-native as suggested in the
  README file.
  
  Now the Home and End keys are ok, because the termcap/terminfo entry
  for these keys is matching.  However, the termcap/terminfo entries
  expect ESC O A to ESC O D for the cursor keys but, as I wrote above,
  rxvt returns the xterm sequences ESC [ A to ESC [ D, so the cursor
  keys don't work anymore.
 
 On further looking into this, it appears that the termcap/terminfo
 entries are wrong.  ESC O A to ESC O D are only generated after
 entering the DEC expanded cursor mode with ESC [ ? 1 h.  The default
 codes are ESC [ A to ESC [ D.  It's not clear to me why the
 termcap/terminfo entries list the expanded mode sequences instead of
 the standard sequences.

I'd like to suggest the below patch.  It aligns the handling of
Home and End key to its xterm counterparts.  That doesn't solve the
problem with the rxvt-cygwin-native termcap/terminfo entries, but it
let rxvt work better in default xterm mode.  Home and End now generate
the vt102/vt220/xterm sequence ESC [ H and ESC [ F.  After switching
to the DEC extended cursor mode, they generate ESC O H and ESC O F,
same as vt102/vt220/xterm.


Corinna


--- command.c.ORIG  2007-08-20 16:51:43.419482700 +0200
+++ command.c   2007-08-20 16:55:20.632170700 +0200
@@ -465,6 +465,8 @@ rxvt_lookup_key(rxvt_t *r, XKeyEvent *ev
 #endif
case XK_End:
STRCPY(kbuf, KS_END);
+   if (r-h-PrivateModes  PrivMode_aplCUR)
+ kbuf[1] = 'O';
break;
 #ifdef XK_KP_Home
case XK_KP_Home:
@@ -477,6 +479,8 @@ rxvt_lookup_key(rxvt_t *r, XKeyEvent *ev
 #endif
case XK_Home:
STRCPY(kbuf, KS_HOME);
+   if (r-h-PrivateModes  PrivMode_aplCUR)
+ kbuf[1] = 'O';
break;
 
 #define FKEY(n, fkey)  \
--- command.h.ORIG  2007-08-20 16:56:10.099082700 +0200
+++ command.h   2007-08-20 16:56:20.687946700 +0200
@@ -38,8 +38,8 @@
 # define KS_HOME   \033[1~   /* Home == Find */
 # define KS_END\033[4~   /* End == Select */
 #else
-# define KS_HOME   \033[7~   /* Home */
-# define KS_END\033[8~   /* End */
+# define KS_HOME   \033[H/* Home */
+# define KS_END\033[F/* End */
 #endif
 
 #ifdef SCROLL_ON_SHIFT

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat


Please upload: mathomatic-12.7.5-1

2007-08-20 Thread Reini Urban

Please upload:

  http://rurban.xarch.at/cygr/mathomatic/mathomatic-12.7.5-1.tar.bz2
  http://rurban.xarch.at/cygr/mathomatic/mathomatic-12.7.5-1-src.tar.bz2

setup.hint unchanged
mathomatic-12.7.0-1 can be deleted (if wanted)
--
Reini










[ITA] fvwm 2.5.21 -- F Virtual Window Manager

2007-08-20 Thread Jari Aalto

Adopted from Harold. Updated to new upstream version.

Jari

sdesc: F Virtual Window Manager
ldesc: A powerful ICCCM2 compliant multiple virtual desktop window
manager for the X Window System. FVWM requires relatively little
memory.
category: X11
requires: cygwin libXft2 libexpat0 libfontconfig1 libfreetype26 libiconv2 
libin\tl8 libncurses8 libpng12 perl readline xorg-x11-base xorg-x11-bin-dlls 
zlib

a) manual downlaod

  wget\
http://cygwin.cante.net/fvwm/fvwm-2.5.21-1.tar.bz2 \
http://cygwin.cante.net/fvwm/fvwm-2.5.21-1-src.tar.bz2 \
http://cygwin.cante.net/fvwm/setup.hint

b) automated: get.sh displays further instructions

  gpg --keyserver wwwkeys.pgp.net --recv-keys 955A92D8

  mkdir fvwm ; cd fvwm
  rm -f get.sh get.sh.sig
  wgethttp://cygwin.cante.net/fvwm/get.sh \
  http://cygwin.cante.net/fvwm/get.sh.sig
  gpg --verify get.sh.sig get.sh 
  sh get.sh



Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Charles Wilson

Brian Dessent wrote:

Corinna Vinschen wrote:


as before.  I'm going to use this patch locally anyway, but maybe that's
one for inclusion upstream?


As far as I know, there is no upstream rxvt -- it's a dead project.  The
rxvt-unicode fork is where new development happens.  I'm not sure what
that means exactly for the W11/Win32 parts of rxvt.  I'm sure Chuck
could answer this a lot more definitively.


Brian's right: upstream rxvt is dead, and rxvt-unicode is where the 
action is.  However, rxvt-unicode does not (yet) have any mechanism for 
non-X11 operation, so I'll keep cygwin's rxvt going.


More downthread.

--
Chuck



Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Charles Wilson

Corinna Vinschen wrote:

I'm just a bit puzzled about the key codes.  By default, when rxvt is
invoked without explicitely setting the terminal name (-tn option),
rxvt is recognized as an xterm.


This is a configure option for rxvt (--with-term=) which defaults to 
xterm.  There are a few differences between rxvt (and 
rxvt-native-cygwin and rxvt-cygwin) and xterm, such as the ACS character 
codes -- and Home, End, Delete, and BackSpace handling.  (Original xterm 
didn't even specify Home/End. Ones newer than ten years do, tho, only 
differently than rxvt).


I've always thought rxvt should report 'rxvt', but since SteveO's 
original version used the default 'xterm' settings, I've never changed 
it.  It *mostly* works in that mode -- and 'xterm' is ALWAYS available 
in /etc/termcap or */terminfo/*, while even the undecorated 'rxvt' might 
be missing.  Like on gentoo-embedded without ncurses-extra-terminfo 
installed.


So, in the absence of -tn, cygwin's rxvt will continue to default to 
'xterm' -- but 'xterm' is NOT a perfect match for rxvt's terminal 
handling, and we shouldn't try to make it so.  If we did, then cygwin's 
rxvt would just be broken on systems that actually HAVE the correct 
(undecorated) 'rxvt' terminfo installed.


However, if it is the list's opinion, I'm willing to be persuaded that 
cygwin's rxvt should default to setting TERM=rxvt in the absence of -tn...



 The cursor keys correctly return
ESC [ A to ESC [ D.  However, the Home and End keys return ESC [ 7 ~
and ESC [ 8 ~, while a real xterm returns ESC [ H and ESC [ F.


From the terminfo.src file, distributed with ncurses, in the 
xterm-color section:


This description [ed: of xterm-color] is compatible with color_xterm, 
rxvt and XFree86 xterm, except that each of those implements the home, 
end, delete keys differently.


So, yeah, here's what terminfo.src says about rxvt-basic:

#   Normal   ShiftControl  Ctrl+Shift
#  Tab  ^I   ESC [ Z  ^I   ESC [ Z
#  BackSpace^H   ^?   ^?   ^?
#  Find ESC [ 1 ~ESC [ 1 $ESC [ 1 ^ESC [ 1 @
#  Insert   ESC [ 2 ~pasteESC [ 2 ^ESC [ 2 @
#  Execute  ESC [ 3 ~ESC [ 3 $ESC [ 3 ^ESC [ 3 @
#  Select   ESC [ 4 ~ESC [ 4 $ESC [ 4 ^ESC [ 4 @
#  PriorESC [ 5 ~scroll-upESC [ 5 ^ESC [ 5 @
#  Next ESC [ 6 ~scroll-down  ESC [ 6 ^ESC [ 6 @
#  Home ESC [ 7 ~ESC [ 7 $ESC [ 7 ^ESC [ 7 @
#  End  ESC [ 8 ~ESC [ 8 $ESC [ 8 ^ESC [ 8 @
#  Delete   ESC [ 3 ~ESC [ 3 $ESC [ 3 ^ESC [ 3 @
#  F1   ESC [ 11 ~   ESC [ 23 ~   ESC [ 11 ^   ESC [ 23 ^
... more function keys ...
#  Up   ESC [ A  ESC [ a  ESC O a  ESC O A
#  Down ESC [ B  ESC [ b  ESC O b  ESC O B
#  RightESC [ C  ESC [ c  ESC O c  ESC O C
#  Left ESC [ D  ESC [ d  ESC O d  ESC O D
#  KP_Enter ^M ESC O M
#  KP_F1ESC O PESC O P
#  KP_F2ESC O QESC O Q
#  KP_F3ESC O RESC O R
#  KP_F4ESC O SESC O S
#  XK_KP_Multiply   *  ESC O j
#  XK_KP_Add+  ESC O k
#  XK_KP_Separator  ,  ESC O l
#  XK_KP_Subtract   -  ESC O m
#  XK_KP_Decimal.  ESC O n
#  XK_KP_Divide /  ESC O o
#  XK_KP_0  0  ESC O p
... more keypad numbers ...


Ok, so I set the terminal to rxvt-cygwin-native as suggested in the
README file.


Frankly, plain old rxvt (or rxvt-color, or rxvt-xpm: all three are 
identical) will work just as well.  The only difference between the 
cygwin variants and rxvt is the ACS charset.  And the two cygwin 
variants differ between each other in only ONE character in that charset.



Now the Home and End keys are ok, because the termcap/terminfo entry
for these keys is matching.  However, the termcap/terminfo entries
expect ESC O A to ESC O D for the cursor keys but, as I wrote above,
rxvt returns the xterm sequences ESC [ A to ESC [ D, so the cursor
keys don't work anymore.


I used to have to fix my /etc/termcap. But now the /etc/termcap in 
termcap-20050421-1.tar.bz2 says:


rxvt|rxvt terminal emulator (X Window System):\
:am:eo:km:mi:ms:xn:xo:\
:co#80:it#8:li#24:\
:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
:K1=\EOw:K2=\EOu:K3=\EOy:K4=\EOq:K5=\EOs:LE=\E[%dD:\
:RI=\E[%dC:UP=\E[%dA:ae=^O:al=\E[L:as=^N:bl=^G:cd=\E[J:\

Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Charles Wilson

Corinna Vinschen wrote:

On further looking into this, it appears that the termcap/terminfo
entries are wrong.  ESC O A to ESC O D are only generated after
entering the DEC expanded cursor mode with ESC [ ? 1 h.  The default
codes are ESC [ A to ESC [ D. 



From what I can tell, the expanded codes SHOULD be
   ESC [ n A   where n is 1-9, not 0  (and '[' should be there)
and should be emitted when in DECCKM mode.  This stuff is all handled in 
src/command.c but it's a twisty maze that all looks the same.



It's not clear to me why the
termcap/terminfo entries list the expanded mode sequences instead of
the standard sequences.


Referring to my previous message, I don't see that in termcap/terminfo 
at all.  All I see is the correct ESC [ A and friends.


--
Chuck



Re: RXVT doesn't recognize ALT + Cursor keys

2007-08-20 Thread Charles Wilson

Charles Wilson wrote:
Thanks.  I'll include this in the next build.  In fact, I'm going to 
generate a test release using this patch, and --with-term=rxvt -- but 
without the 'make cygwin rxvt act like xterm, even though all other rxvt 
do not' patch.  I really think that issue is a bug in your 
termcap/terminfo files, because mine don't specify the things your do. 
I'll post an archive with my precompiled terminfo/r/rxvt* files and 
/etc/termcap, for testing.


rxvt-20050409-5 should propagate to the mirrors soon (as test release). 
 Try it with the attached termcap/terminfo files.


--
Chuck


rxvt-term.tar.bz2
Description: Binary data