public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* Problem with WinXP, XF86, Caps lock, xterm and cursor keys
@ 2003-11-24 20:50 Alan Shutko
  2003-11-25  9:51 ` Alexander Gottwald
  2003-11-26  4:21 ` Takuma Murakami
  0 siblings, 2 replies; 8+ messages in thread
From: Alan Shutko @ 2003-11-24 20:50 UTC (permalink / raw)
  To: cygwin-xfree

I've just gotten a new laptop at work with WinXP, and put Cygwin and
XF86 on it.  I'm currently running the latest as of today (4.3.0-25
server).

I've disabled my capslock key and turned it into a control key with
this registry hack:

REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00

My caps lock key correctly works as a control key in all windows
applications, and xev shows it acts just like Control_L.

In xterm, I can use the caps lock key as a control key.  Except, each
time I press it, my arrow keys toggle between sending the correct
"^[[A" and the strange "^[[1;2A" (for up; left, down and right have
similar changes).  Apparently, it's toggling the cursor keys into
"shifted" state, because that's the "shifted" up arrow key.

This only affects the arrow keys, and page up/page down (which are
toggled into scrolling).  It seems like there's a bug somewhere
tracking the caps lock, since I seem to have correctly disabled caps
lock for number keys, but not arrows.

-- 
Alan Shutko <ats@acm.org> - I am the rocks.
I'm not even going to ignore that.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem with WinXP, XF86, Caps lock, xterm and cursor keys
  2003-11-24 20:50 Problem with WinXP, XF86, Caps lock, xterm and cursor keys Alan Shutko
@ 2003-11-25  9:51 ` Alexander Gottwald
  2003-11-25 18:39   ` Alan Shutko
  2003-11-26  4:21 ` Takuma Murakami
  1 sibling, 1 reply; 8+ messages in thread
From: Alexander Gottwald @ 2003-11-25  9:51 UTC (permalink / raw)
  To: cygwin-xfree

On Mon, 24 Nov 2003, Alan Shutko wrote:

> I've just gotten a new laptop at work with WinXP, and put Cygwin and
> XF86 on it.  I'm currently running the latest as of today (4.3.0-25
> server).
> 
> I've disabled my capslock key and turned it into a control key with
> this registry hack:
> 
> REGEDIT4
> 
> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
> "Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
> 
> My caps lock key correctly works as a control key in all windows
> applications, and xev shows it acts just like Control_L.
> 
> In xterm, I can use the caps lock key as a control key.  Except, each
> time I press it, my arrow keys toggle between sending the correct
> "^[[A" and the strange "^[[1;2A" (for up; left, down and right have
> similar changes).  Apparently, it's toggling the cursor keys into
> "shifted" state, because that's the "shifted" up arrow key.
> 
> This only affects the arrow keys, and page up/page down (which are
> toggled into scrolling).  It seems like there's a bug somewhere
> tracking the caps lock, since I seem to have correctly disabled caps
> lock for number keys, but not arrows.

Cygwin/XFree uses raw scancodes and uses XKB for symbol translation.
Your tweaking will most likely break this conversion.

I declare such a modification as unsupported. You may still ask for
pointers to documentation but I (and most likely the other regulars
too) am not willing to debug such strange modifications.

bye
	ago
-- 
 Alexander.Gottwald@s1999.tu-chemnitz.de 
 http://www.gotti.org           ICQ: 126018723


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem with WinXP, XF86, Caps lock, xterm and cursor keys
  2003-11-25  9:51 ` Alexander Gottwald
@ 2003-11-25 18:39   ` Alan Shutko
  2003-11-25 18:45     ` Harold L Hunt II
  2003-11-25 18:55     ` Alan Shutko
  0 siblings, 2 replies; 8+ messages in thread
From: Alan Shutko @ 2003-11-25 18:39 UTC (permalink / raw)
  To: cygwin-xfree

Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> writes:

> Cygwin/XFree uses raw scancodes and uses XKB for symbol translation.
> Your tweaking will most likely break this conversion.

I could understand that, if it were consistent.  If Cygwin/XFree
considered that key to still be caps lock, I could easily fix it with
xmodmap.  But it doesn't, xev sees it as control.  Furthermore, why is
it shifting arrow keys and page up/down but not anything else?

Finally, why is caps lock affecting those keys at all?  I haven't seen
that on XFree86 on Linux, nor on any other X server I've tried.
Personally, I suspect that some piece of code is handling things
differently than the rest, so even the usual methods of fixing things
(ie, xresources, xmodmap) may not fix things.  (But I'll be giving it
a try, since it's easy.)

> I declare such a modification as unsupported. You may still ask for
> pointers to documentation 

I'll take you up on that offer.  Could you point me to some
info on how Cygwin/XFree86 gets those scancodes and runs the
conversion?  Maybe I could put together a variant XKB layout without
caps lock....

-- 
Alan Shutko <ats@acm.org> - I am the rocks.
St. Vidicon of Cathode, pray for us!


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem with WinXP, XF86, Caps lock, xterm and cursor keys
  2003-11-25 18:39   ` Alan Shutko
@ 2003-11-25 18:45     ` Harold L Hunt II
  2003-11-25 21:10       ` Alan Shutko
  2003-11-25 18:55     ` Alan Shutko
  1 sibling, 1 reply; 8+ messages in thread
From: Harold L Hunt II @ 2003-11-25 18:45 UTC (permalink / raw)
  To: cygwin-xfree

The only special handling that I can think of is here:

<http://cvsweb.xfree86.org/cvsweb/xc/programs/Xserver/\
hw/xwin/winkeybd.h?rev=1.3&content-type=text/x-cvsweb-markup>

Look at the section after the following line (WIN_NEW_KEYBOARD_SUPPORT 
is set to NO):

#else /* WIN_NEW_KEYBOARD_SUPPORT */

But that code just maps scan codes depending on whether or not the key 
is flagged as "extended", which sort of distinquishes the normal arrow 
keys from the keypad arrow keys, etc.

You see, we don't do this sort of translation on our own.  It may be 
that Windows is sending different codes when CapsLock is down, in which 
case we might want to translate those different codes to match the 
normal codes.  Does that make sense?

Harold

Alan Shutko wrote:

> Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> writes:
> 
> 
>>Cygwin/XFree uses raw scancodes and uses XKB for symbol translation.
>>Your tweaking will most likely break this conversion.
> 
> 
> I could understand that, if it were consistent.  If Cygwin/XFree
> considered that key to still be caps lock, I could easily fix it with
> xmodmap.  But it doesn't, xev sees it as control.  Furthermore, why is
> it shifting arrow keys and page up/down but not anything else?
> 
> Finally, why is caps lock affecting those keys at all?  I haven't seen
> that on XFree86 on Linux, nor on any other X server I've tried.
> Personally, I suspect that some piece of code is handling things
> differently than the rest, so even the usual methods of fixing things
> (ie, xresources, xmodmap) may not fix things.  (But I'll be giving it
> a try, since it's easy.)
> 
> 
>>I declare such a modification as unsupported. You may still ask for
>>pointers to documentation 
> 
> 
> I'll take you up on that offer.  Could you point me to some
> info on how Cygwin/XFree86 gets those scancodes and runs the
> conversion?  Maybe I could put together a variant XKB layout without
> caps lock....
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem with WinXP, XF86, Caps lock, xterm and cursor keys
  2003-11-25 18:39   ` Alan Shutko
  2003-11-25 18:45     ` Harold L Hunt II
@ 2003-11-25 18:55     ` Alan Shutko
  2003-11-25 19:04       ` Harold L Hunt II
  1 sibling, 1 reply; 8+ messages in thread
From: Alan Shutko @ 2003-11-25 18:55 UTC (permalink / raw)
  To: cygwin-xfree

Alan Shutko <ats@acm.org> writes:

> Personally, I suspect that some piece of code is handling things
> differently than the rest, so even the usual methods of fixing things
> (ie, xresources, xmodmap) may not fix things.  (But I'll be giving it
> a try, since it's easy.)

I'm able to use X resources to have xterm treat Shift-cursor the same
as (application) cursor keys.  I also discovered that xev is showing
a Shift_L keydown before hitting the affected keys.  I haven't tried
turning caps lock off with xkb yet.

Is there a tool lower-level than xev which shows what XF86 is getting
from Windows?

-- 
Alan Shutko <ats@acm.org> - I am the rocks.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem with WinXP, XF86, Caps lock, xterm and cursor keys
  2003-11-25 18:55     ` Alan Shutko
@ 2003-11-25 19:04       ` Harold L Hunt II
  0 siblings, 0 replies; 8+ messages in thread
From: Harold L Hunt II @ 2003-11-25 19:04 UTC (permalink / raw)
  To: cygwin-xfree

Have you got Spy++ from any version of Visual Studio?  It will show you 
keyboard messages and you can check if the field that we check is 
changing depending on whether Caps Lock is down or not.

Harold

Alan Shutko wrote:

> Alan Shutko <ats@acm.org> writes:
> 
> 
>>Personally, I suspect that some piece of code is handling things
>>differently than the rest, so even the usual methods of fixing things
>>(ie, xresources, xmodmap) may not fix things.  (But I'll be giving it
>>a try, since it's easy.)
> 
> 
> I'm able to use X resources to have xterm treat Shift-cursor the same
> as (application) cursor keys.  I also discovered that xev is showing
> a Shift_L keydown before hitting the affected keys.  I haven't tried
> turning caps lock off with xkb yet.
> 
> Is there a tool lower-level than xev which shows what XF86 is getting
> from Windows?
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem with WinXP, XF86, Caps lock, xterm and cursor keys
  2003-11-25 18:45     ` Harold L Hunt II
@ 2003-11-25 21:10       ` Alan Shutko
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Shutko @ 2003-11-25 21:10 UTC (permalink / raw)
  To: cygwin-xfree

Harold L Hunt II <huntharo@msu.edu> writes:

> You see, we don't do this sort of translation on our own.  It may be
> that Windows is sending different codes when CapsLock is down, in
> which case we might want to translate those different codes to match
> the normal codes.  Does that make sense?

Makes sense.  Unfortunately, I don't have Spy++, but I'll keep
working on it....

-- 
Alan Shutko <ats@acm.org> - I am the rocks.
"Let the carnage begin!" - Larry


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problem with WinXP, XF86, Caps lock, xterm and cursor keys
  2003-11-24 20:50 Problem with WinXP, XF86, Caps lock, xterm and cursor keys Alan Shutko
  2003-11-25  9:51 ` Alexander Gottwald
@ 2003-11-26  4:21 ` Takuma Murakami
  1 sibling, 0 replies; 8+ messages in thread
From: Takuma Murakami @ 2003-11-26  4:21 UTC (permalink / raw)
  To: cygwin-xfree

Alan Shutko wrote:

> I've disabled my capslock key and turned it into a control key with
> this registry hack:

For your information, I am using the same scancode map
on a system.  The system is JP Windows, US keyboard,
XKB enabled, no XF86Config file, and "setxkbmap -print"
prints:
xkb_keymap {
        xkb_keycodes  { include "xfree86+aliases(qwerty)"       };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc/pc(pc101)+pc/us"    };
        xkb_geometry  { include "pc(pc101)"     };
};
I can't reproduce your problems on this system.

Ideally speaking, changes of Windows scancode mapper are
invisible from Cygwin/X.  Because scancodes are the only
information Cygwin/X uses, your Caps Lock key and Control
key should be completely equivalent for Cygwin/X.

I hope you track down your problem.

Takuma Murakami (murakami@ipl.t.u-tokyo.ac.jp)


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-11-26  4:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-24 20:50 Problem with WinXP, XF86, Caps lock, xterm and cursor keys Alan Shutko
2003-11-25  9:51 ` Alexander Gottwald
2003-11-25 18:39   ` Alan Shutko
2003-11-25 18:45     ` Harold L Hunt II
2003-11-25 21:10       ` Alan Shutko
2003-11-25 18:55     ` Alan Shutko
2003-11-25 19:04       ` Harold L Hunt II
2003-11-26  4:21 ` Takuma Murakami

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).