PATCH: Fix Numlock/Capslock synchronization

2008-11-23 Thread Jon TURNEY


xorg-server-1.5.3-3 temporary disabled the NumLock/CapsLock synchronization
between X and windows as it was badly broken. (In 1.5.3-2, if NumLock or 
Capslock was on, it would toggle everytime an X window gained focus)


This patch repairs that synchronization, so the X server's idea about these 
locking keyboard modes is updated correctly when an X window regains focus
Cygwin: Fix the keyboard mode key synchronization

Fix the code which generates fake keypresses when an X window gains focus to
bring the X servers idea of the state of these mode keys in to sync with any
changes which might have taken place whilst unfocused.

With MPX changes, the place the server stores the current mode key state has
changed, appears they are now only held on the virtual core keyboard.

---
 xserver/hw/xwin/winkeybd.c |   15 ---
 1 file changed, 4 insertions(+), 11 deletions(-)

Index: xorg-server-1.5.3/xserver/hw/xwin/winkeybd.c
===
--- xorg-server-1.5.3.orig/xserver/hw/xwin/winkeybd.c
+++ xorg-server-1.5.3/xserver/hw/xwin/winkeybd.c
@@ -49,10 +49,6 @@
 
 static Bool g_winKeyState[NUM_KEYCODES];
 
-/* Stored to get internal mode key states.  Must be read-only.  */
-static unsigned short const *g_winInternalModeKeyStatesPtr = NULL;
-
-
 /*
  * Local prototypes
  */
@@ -209,7 +205,6 @@ winKeybdBell (int iPercent, DeviceIntPtr
 static void
 winKeybdCtrl (DeviceIntPtr pDevice, KeybdCtrl *pCtrl)
 {
-  g_winInternalModeKeyStatesPtr = &(pDevice->key->state);
 }
 
 
@@ -295,19 +290,15 @@ winKeybdProc (DeviceIntPtr pDeviceInt, i
 }
 }
 #endif
-
-  g_winInternalModeKeyStatesPtr = &(pDeviceInt->key->state);
   break;
   
 case DEVICE_ON: 
   pDevice->on = TRUE;
-  g_winInternalModeKeyStatesPtr = &(pDeviceInt->key->state);
   break;
 
 case DEVICE_CLOSE:
 case DEVICE_OFF: 
   pDevice->on = FALSE;
-  g_winInternalModeKeyStatesPtr = NULL;
   break;
 }
 
@@ -369,7 +360,7 @@ winRestoreModeKeyStates ()
   unsigned short   internalKeyStates;
 
   /* X server is being initialized */
-  if (!g_winInternalModeKeyStatesPtr)
+  if (!inputInfo.keyboard)
 return;
 
   /* Only process events if the rootwindow is mapped. The keyboard events
@@ -382,7 +373,9 @@ winRestoreModeKeyStates ()
 mieqProcessInputEvents ();
   
   /* Read the mode key states of our X server */
-  internalKeyStates = *g_winInternalModeKeyStatesPtr;
+  /* (stored in the virtual core keyboard) */
+  internalKeyStates = inputInfo.keyboard->key->state;
+  winDebug("winRestoreModeKeyStates: state %d\n", internalKeyStates);
 
   /* 
* NOTE: The C XOR operator, ^, will not work here because it is

--
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple
Problem reports:   http://cygwin.com/problems.html
Documentation: http://x.cygwin.com/docs/
FAQ:   http://x.cygwin.com/docs/faq/

Numlock & Capslock change status on focus in xterm

2008-11-19 Thread Dont Care
Hi all.

I updated Cygwin yesterday, I had no problem before.

In xterm, both Numlock and Capslock modifiers are changing status by
gaining focus.

If Capslock is off, there is no problem : xterm stay in lowercase. If
it is on, gaining focus make change the status (first Alt-tab=>off,
second Alt-tab=>on, etc.). Same thing with Numlock.

Some infos about my installed versions :

$ xterm -version
Cygwin 6.8.99.903(237)

]$ X -version
Welcome to the XWin X Server
Vendor: The Cygwin/X Project
Release: 1.5.3.0 (10503000)

Contact: cygwin-xfree@cygwin.com

$ cygcheck -s
[...]
Cygwin DLL version info:
DLL version: 1.5.25
DLL epoch: 19
DLL bad signal mask: 19005
DLL old termios: 5
DLL malloc env: 28
API major: 0
API minor: 156
Shared data: 4
DLL identifier: cygwin1
Mount registry: 2
Cygnus registry name: Cygnus Solutions
Cygwin registry name: Cygwin
Program options name: Program Options
Cygwin mount registry name: mounts v2
Cygdrive flags: cygdrive flags
Cygdrive prefix: cygdrive prefix
Cygdrive default prefix:
Build date: Thu Jun 12 19:34:46 CEST 2008
CVS tag: cr-0x5f1
Shared id: cygwin1S4
[...]
Cygwin Package Information
Package Version
_update-info-dir00780-1
alternatives1.3.30c-2
ash 20040127-4
base-files  3.7-1
base-passwd 2.2-1
bash3.2.39-20
binutils20080624-2
bzip2   1.0.5-2
coreutils   6.10-2
crypt   1.1-1
csih0.1.8-1
cvs 1.11.22-1
cygrunsrv   1.34-1
cygutils1.3.2-1
cygwin  1.5.25-15
cygwin-doc  1.4-4
diffutils   2.8.7-1
e2fsprogs   1.35-3
editrights  1.01-2
expat   2.0.1-1
file4.21-1
findutils   4.4.0-3
font-alias  1.0.1-1
font-bitstream-dpi751.0.0-1
font-bitstream-vera-ttf 1.10-1
font-cursor-misc1.0.0-1
font-encodings  1.0.2-1
font-misc-misc  1.0.0-1
fontconfig  2.6.0-1
freetype2   2.3.7-1
gawk3.1.6-1
gcc 3.4.4-3
gcc-core3.4.4-3
gcc-g++ 3.4.4-3
gcc-mingw-core  20050522-1
gcc-mingw-g++   20050522-1
gdb 6.8-2
gettext 0.17-1
grep2.5.3-1
groff   1.19.2-2
gzip1.3.12-2
less382-1
libbz2_11.0.5-2
libdb4.54.5.20.2-2
libexpat0   1.95.8-2
libexpat1   2.0.1-1
libexpat1-devel 2.0.1-1
libfontconfig1  2.6.0-1
libfontenc1 1.0.4-2
libfreetype2-devel  2.3.7-1
libfreetype26   2.3.7-1
libgdbm41.8.3-8
libGL1  7.2-2
libICE6 1.0.4-2
libiconv2   1.12-1
libintl10.10.40-1
libintl20.12.1-3
libintl30.14.5-1
libintl80.17-1
libncurses7 5.3-4
libncurses8 5.5-3
libpcre07.8-1
libpixman1_00.12.0-1
libpopt01.6.4-4
libreadline65.2.12-10
libSM6  1.1.0-1
libwrap07.6-4
libX11_61.1.5-1
libXau6 1.0.4-1
libXaw7 1.0.4-2
libxcb-xlib01.1-2
libxcb1 1.1-2
libXdmcp6   1.0.2-3
libXext61.0.4-1
libXft1 1.0.0-1
libXft2 2.1.13-1
libxkbfile1 1.0.5-2
libXmu6 1.0.4-1
libXmuu11.0.4-1
libXpm4 3.5.7-2
libXrender1 0.9.4-2
libXt6  1.0.5-2
lndir   1.0.1-2
login   1.9-8
luit1.0.3-1
make3.81-2
man 1.6e-1
mingw-runtime   3.15.1-1
minires 1.01-1
mkfontdir   1.0.4-1
mkfontscale 1.0.5-1
openssh 5.1p1-9
openssl 0.9.8i-1
pcre7.8-1
perl5.10.0-5
rebase  2.4.4-1
rgb 1.0.3-1
run 1.1.10-1
rxvt20050409-9
sed 4.1.5-2
tar 1.20-1
tcltk   20080420-1
termcap 20050421-1
terminfo5.5_20061104-1
texinfo 4.8a-1
tzcode  2008a-1
util-linux  2.13.1-2
vim 7.2-3
w32api  3.12-1
wget1.11.3-1
which   2.19-1
wtf 0.0.4-6
X-startup-scripts   1.1.0-2
xauth   1.0.3-1
x

Re: Numlock and java applications

2005-06-27 Thread Igor Pechtchanski
Wrong list.  Questions about Cygwin/X should be sent to the cygwin-xfree
list.  Redirecting.

On Mon, 27 Jun 2005, Casolaro, Didier wrote:

> Hello,
> I'm developping and testing java application under KDE (3.4.0)
> environment trough cygwing running on Windows XP. If numlock key is
> active, some keys of my keyboard (enter, arrows, numpad keys, backspace)
> don't work any more with any java application.
> Is there any patch anywhere to make java application working properly
> without having to unlock numlock key?
>
> Thanx for your answer...

AFAIK, no.  But you may get other answers on the cygwin-xfree list.
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_[EMAIL PROTECTED]
 |,4-  ) )-,_. ,\ (  `'-'   Igor Pechtchanski, Ph.D.
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"The Sun will pass between the Earth and the Moon tonight for a total
Lunar eclipse..." -- WCBS Radio Newsbrief, Oct 27 2004, 12:01 pm EDT


Re: numlock

2004-04-23 Thread J S

Harold,

This is simply a bug report. The FACT is that if you start XFree with the 
numlock key on, the keyboard doesn't work properly. There have been plenty 
of other posts about this in the past so I'm not the first to report this. 
Even if you don't care about it, and it doesn't affect you, I think you'll 
find a lot of users (who don't necessarily post here) have come across the 
numlock issue. I know my users have, and everyone agrees this is a BUG.
I don't agree that it is a bug.  I believe that this is simply the side 
effect of changes made to how numlock is handled in the X Window System; 
those changes were beyond our control and not all libraries and 
applications have been updated in the 5 or more years since those changes 
to handle numlock properly.  Thus, anything that we do to turn numlock off 
will only be a partial work-around, not a bug fix.  If it was a bug fix 
then it would apply all the time, but it can't be applied all the time 
because the majority of users that don't use LessTif or Motif applications 
will wonder why their numlock key keeps turning off.

No one has asked you to do the work for this though - If I can, I'll 
provide the patch using Thomas' code, but as the one in charge of this 
project, you're the man who says whether such a patch goes into the build. 
I was just trying to get some involvement from you, maybe encouragement.
Yeah you did ask me to do the work, you sent me a private message asking if 
I was interested.

I'm not saying it wouldn't go in.  I think it is farely obvious that it 
something doesn't change the default behavior then it goes in almost 
automatically.  I say go for it.

Now, you might still be wondering why I'm not interested.  I'm not 
interested in writing it myself because I spent about five minutes thinking 
about it and came up with various questions about how this should behave 
when Cygwin/X loses or regains keyboard focus.  I also don't particularly 
like changing the keyboard state.  Then I started thinking that maybe a 
better way to do this would be to make a command-line parameter that causes 
numlock to not be specified as a mask key.  I also figured that an even 
better way may be an option on the tray menu that lets you toggle a 
numlock-override during your session that just makes numlock look like it 
is off without actually changing the keyboard state.

See what I mean about how I don't think this has been completely thought 
out?  Somebody needs to make this one their own and it sounds like you are 
interested, so go for it.

I personally liked the idea of adding a flag to the XWin command line e.g.

Xwin -numlockoff

but if you're saying this is a non-starter I won't bother.
I never said it was a non-starter.  I just said "I'm not the man for the 
job" because it sounded like you were asking me to write the code for you.

Absolutely not. If it sounded like I was asking you to do the work - that's 
my fault, I should have worded my email better, I only wanted your 
advice/approval.
That said, you did seem to be ignoring the numlock issue. Usually you are 
very quick to reply and helpful, aren't you?! :)
Believe it or not, I get a lot of grief about the numlock key and I tried 
telling my users what you said before about it not being a bug, but now 
everyone thinks I'm in denial! They call me "numnuts" at work now!
Anyway, you obviously have a better understanding of the problem but I don't 
think you can expect a bugfix to anticipate future changes. I doubt whether 
today's XFree will work on all future releases of Windows.

I'll crack on with trying to write a patch and hopefully I'll be able to 
contribute some code (with a bit of support and guidance along the way?).

Cheers,

JS.

_
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo


Re: numlock

2004-04-23 Thread Harold L Hunt II
JS,

J S wrote:

Harold,

This is simply a bug report. The FACT is that if you start XFree with 
the numlock key on, the keyboard doesn't work properly. There have been 
plenty of other posts about this in the past so I'm not the first to 
report this. Even if you don't care about it, and it doesn't affect you, 
I think you'll find a lot of users (who don't necessarily post here) 
have come across the numlock issue. I know my users have, and everyone 
agrees this is a BUG.
I don't agree that it is a bug.  I believe that this is simply the side 
effect of changes made to how numlock is handled in the X Window System; 
those changes were beyond our control and not all libraries and 
applications have been updated in the 5 or more years since those 
changes to handle numlock properly.  Thus, anything that we do to turn 
numlock off will only be a partial work-around, not a bug fix.  If it 
was a bug fix then it would apply all the time, but it can't be applied 
all the time because the majority of users that don't use LessTif or 
Motif applications will wonder why their numlock key keeps turning off.

No one has asked you to do the work for this though - If I can, I'll 
provide the patch using Thomas' code, but as the one in charge of this 
project, you're the man who says whether such a patch goes into the 
build. I was just trying to get some involvement from you, maybe 
encouragement.
Yeah you did ask me to do the work, you sent me a private message asking 
if I was interested.

I'm not saying it wouldn't go in.  I think it is farely obvious that it 
something doesn't change the default behavior then it goes in almost 
automatically.  I say go for it.

Now, you might still be wondering why I'm not interested.  I'm not 
interested in writing it myself because I spent about five minutes 
thinking about it and came up with various questions about how this 
should behave when Cygwin/X loses or regains keyboard focus.  I also 
don't particularly like changing the keyboard state.  Then I started 
thinking that maybe a better way to do this would be to make a 
command-line parameter that causes numlock to not be specified as a mask 
key.  I also figured that an even better way may be an option on the 
tray menu that lets you toggle a numlock-override during your session 
that just makes numlock look like it is off without actually changing 
the keyboard state.

See what I mean about how I don't think this has been completely thought 
out?  Somebody needs to make this one their own and it sounds like you 
are interested, so go for it.

I personally liked the idea of adding a flag to the XWin command line e.g.

Xwin -numlockoff

but if you're saying this is a non-starter I won't bother.
I never said it was a non-starter.  I just said "I'm not the man for the 
job" because it sounded like you were asking me to write the code for you.

Harold


Re: numlock

2004-04-23 Thread J S
Thanks a lot Alex. I'll do my best.


> Harold,
>
> This is simply a bug report. The FACT is that if you start XFree with 
the
> numlock key on, the keyboard doesn't work properly. There have been 
plenty
> of other posts about this in the past so I'm not the first to report 
this.
> Even if you don't care about it, and it doesn't affect you, I think 
you'll
> find a lot of users (who don't necessarily post here) have come across 
the
> numlock issue. I know my users have, and everyone agrees this is a BUG.
>
> No one has asked you to do the work for this though - If I can, I'll 
provide
> the patch using Thomas' code, but as the one in charge of this project,
> you're the man who says whether such a patch goes into the build. I was 
just
> trying to get some involvement from you, maybe encouragement.

Go on. If the patch is good an useful there are very good chances it will 
be
included.

> Xwin -numlockoff

sounds good.

bye
ago
--
 [EMAIL PROTECTED]
 http://www.gotti.org   ICQ: 126018723
_
Express yourself with cool emoticons - download MSN Messenger today! 
http://www.msn.co.uk/messenger



Re: numlock

2004-04-23 Thread J S
Thanks a lot Alex. I'll do my best.


> Harold,
>
> This is simply a bug report. The FACT is that if you start XFree with 
the
> numlock key on, the keyboard doesn't work properly. There have been 
plenty
> of other posts about this in the past so I'm not the first to report 
this.
> Even if you don't care about it, and it doesn't affect you, I think 
you'll
> find a lot of users (who don't necessarily post here) have come across 
the
> numlock issue. I know my users have, and everyone agrees this is a BUG.
>
> No one has asked you to do the work for this though - If I can, I'll 
provide
> the patch using Thomas' code, but as the one in charge of this project,
> you're the man who says whether such a patch goes into the build. I was 
just
> trying to get some involvement from you, maybe encouragement.

Go on. If the patch is good an useful there are very good chances it will 
be
included.

> Xwin -numlockoff

sounds good.

bye
ago
--
 [EMAIL PROTECTED]
 http://www.gotti.org   ICQ: 126018723
_
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo


Re: numlock

2004-04-23 Thread Alexander Gottwald
On Fri, 23 Apr 2004, J S wrote:

> Harold,
> 
> This is simply a bug report. The FACT is that if you start XFree with the 
> numlock key on, the keyboard doesn't work properly. There have been plenty 
> of other posts about this in the past so I'm not the first to report this. 
> Even if you don't care about it, and it doesn't affect you, I think you'll 
> find a lot of users (who don't necessarily post here) have come across the 
> numlock issue. I know my users have, and everyone agrees this is a BUG.
> 
> No one has asked you to do the work for this though - If I can, I'll provide 
> the patch using Thomas' code, but as the one in charge of this project, 
> you're the man who says whether such a patch goes into the build. I was just 
> trying to get some involvement from you, maybe encouragement.

Go on. If the patch is good an useful there are very good chances it will be 
included.

> Xwin -numlockoff

sounds good.

bye
ago
-- 
 [EMAIL PROTECTED] 
 http://www.gotti.org   ICQ: 126018723


Re: numlock

2004-04-23 Thread J S
Harold,

This is simply a bug report. The FACT is that if you start XFree with the 
numlock key on, the keyboard doesn't work properly. There have been plenty 
of other posts about this in the past so I'm not the first to report this. 
Even if you don't care about it, and it doesn't affect you, I think you'll 
find a lot of users (who don't necessarily post here) have come across the 
numlock issue. I know my users have, and everyone agrees this is a BUG.

No one has asked you to do the work for this though - If I can, I'll provide 
the patch using Thomas' code, but as the one in charge of this project, 
you're the man who says whether such a patch goes into the build. I was just 
trying to get some involvement from you, maybe encouragement.

I personally liked the idea of adding a flag to the XWin command line e.g.

Xwin -numlockoff

but if you're saying this is a non-starter I won't bother.

JS.


I don't have time for it, don't have a need for it, and don't think that 
anyone has done a complete job of specifying exactly what it is that they 
would want this to do.  As such, I'm not the right man for that job.

Harold

J S wrote:

Harold/Alex? Can you comment on Thomas' email below? Would you be able to 
add the numlockoff code into the XFree build?

Could this code be added into the XFree build?


[snip]

Not sure.  That's a question for Harold, et. al. to answer.  The options 
would be to (1) incorporate this code into the XWin codebase and 
"activate" it via a command-line switch, or (2) include it as a separate 
executable in the xorg-x11-bin package, and call it from the startxwin 
script.

_
Check out MSN PC Safety & Security to help ensure your PC is protected 
and safe. http://specials.msn.com/msn/security.asp

_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger


_
Find a cheaper internet access deal - choose one to suit you. 
http://www.msn.co.uk/internetaccess



Re: numlock

2004-04-22 Thread Harold L Hunt II
I don't have time for it, don't have a need for it, and don't think that 
anyone has done a complete job of specifying exactly what it is that 
they would want this to do.  As such, I'm not the right man for that job.

Harold

J S wrote:

Harold/Alex? Can you comment on Thomas' email below? Would you be able 
to add the numlockoff code into the XFree build?

Could this code be added into the XFree build?


[snip]

Not sure.  That's a question for Harold, et. al. to answer.  The 
options would be to (1) incorporate this code into the XWin codebase 
and "activate" it via a command-line switch, or (2) include it as a 
separate executable in the xorg-x11-bin package, and call it from the 
startxwin script.

_
Check out MSN PC Safety & Security to help ensure your PC is protected 
and safe. http://specials.msn.com/msn/security.asp

_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger




Re: numlock

2004-04-22 Thread J S
Harold/Alex? Can you comment on Thomas' email below? Would you be able to 
add the numlockoff code into the XFree build?

Could this code be added into the XFree build?
[snip]

Not sure.  That's a question for Harold, et. al. to answer.  The options 
would be to (1) incorporate this code into the XWin codebase and "activate" 
it via a command-line switch, or (2) include it as a separate executable in 
the xorg-x11-bin package, and call it from the startxwin script.

_
Check out MSN PC Safety & Security to help ensure your PC is protected and 
safe. http://specials.msn.com/msn/security.asp

_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger



Re: numlock

2004-04-20 Thread Thomas Chadwick
From: "J S" 
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: numlock
Date: Tue, 20 Apr 2004 09:48:37 +


Could this code be added into the XFree build?
[snip]

Not sure.  That's a question for Harold, et. al. to answer.  The options 
would be to (1) incorporate this code into the XWin codebase and "activate" 
it via a command-line switch, or (2) include it as a separate executable in 
the xorg-x11-bin package, and call it from the startxwin script.

_
Check out MSN PC Safety & Security to help ensure your PC is protected and 
safe. http://specials.msn.com/msn/security.asp



Re: numlock

2004-04-20 Thread J S


Could this code be added into the XFree build?

JS.
OK.  You asked for it.  Below is a short C program which will check the 
state of the NumLock key and synthesize a keydown/keyup sequence of the 
NumLock key if it's down.  Works on my box, which is Win2K, but I'm led to 
believe from the documentation that it should work with any 32-bit 
implementation of windows.

To build it, copy-paste the following source into a file (e.g. 
"numlockoff.c") then run gcc on it (e.g. "gcc -o numlockoff numlockoff.c"). 
 Then add that to a convenient location on your client systems and add a 
call to it in your X startup script.

#include 
#define _WIN32_WINNT 0x0500
#include 
int main()
{
   INPUT pInput[2];
   if (GetKeyState(VK_NUMLOCK) == 1)
   {
   pInput[0].type   = INPUT_KEYBOARD;
   pInput[0].ki.wVk = VK_NUMLOCK;
   pInput[0].ki.wScan   = 0;
   pInput[0].ki.dwFlags = 0; /* Nill for keydown */
   pInput[0].ki.time= 0;
   pInput[0].ki.dwExtraInfo = 0;
   pInput[1].type   = INPUT_KEYBOARD;
   pInput[1].ki.wVk = VK_NUMLOCK;
   pInput[1].ki.wScan   = 0;
   pInput[1].ki.dwFlags = KEYEVENTF_KEYUP;
   pInput[1].ki.time= 0;
   pInput[1].ki.dwExtraInfo = 0;
   if (SendInput(2, pInput, sizeof(INPUT)) == 0)
   {
   fprintf(stderr, "Error: SendInput failed.  NumLock was not 
turned off.\n");
   }
   }
}

_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.com/go/onm00200415ave/direct/01/

_
Find a cheaper internet access deal - choose one to suit you. 
http://www.msn.co.uk/internetaccess



Re: numlock

2004-04-20 Thread J S
Thomas,

Thank-you very very much!!! This is an excellent solution and works like a 
treat!! Thanks so much.

JS.

OK.  You asked for it.  Below is a short C program which will check the 
state of the NumLock key and synthesize a keydown/keyup sequence of the 
NumLock key if it's down.  Works on my box, which is Win2K, but I'm led to 
believe from the documentation that it should work with any 32-bit 
implementation of windows.

To build it, copy-paste the following source into a file (e.g. 
"numlockoff.c") then run gcc on it (e.g. "gcc -o numlockoff numlockoff.c"). 
 Then add that to a convenient location on your client systems and add a 
call to it in your X startup script.

#include 
#define _WIN32_WINNT 0x0500
#include 
int main()
{
   INPUT pInput[2];
   if (GetKeyState(VK_NUMLOCK) == 1)
   {
   pInput[0].type   = INPUT_KEYBOARD;
   pInput[0].ki.wVk = VK_NUMLOCK;
   pInput[0].ki.wScan   = 0;
   pInput[0].ki.dwFlags = 0; /* Nill for keydown */
   pInput[0].ki.time= 0;
   pInput[0].ki.dwExtraInfo = 0;
   pInput[1].type   = INPUT_KEYBOARD;
   pInput[1].ki.wVk = VK_NUMLOCK;
   pInput[1].ki.wScan   = 0;
   pInput[1].ki.dwFlags = KEYEVENTF_KEYUP;
   pInput[1].ki.time= 0;
   pInput[1].ki.dwExtraInfo = 0;
   if (SendInput(2, pInput, sizeof(INPUT)) == 0)
   {
   fprintf(stderr, "Error: SendInput failed.  NumLock was not 
turned off.\n");
   }
   }
}

_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.com/go/onm00200415ave/direct/01/

_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger



Re: numlock

2004-04-19 Thread Thomas Chadwick
From: "J S" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: numlock
Date: Sun, 18 Apr 2004 09:36:37 +
[snip]

Thanks for your reply. Unfortunately our users' boxes are locked down 
(they're on XP) so they wouldn't be able to edit that file. I was really 
looking for a way to do this from the XFree startup script or configuration 
anyway.
OK.  You asked for it.  Below is a short C program which will check the 
state of the NumLock key and synthesize a keydown/keyup sequence of the 
NumLock key if it's down.  Works on my box, which is Win2K, but I'm led to 
believe from the documentation that it should work with any 32-bit 
implementation of windows.

To build it, copy-paste the following source into a file (e.g. 
"numlockoff.c") then run gcc on it (e.g. "gcc -o numlockoff numlockoff.c").  
Then add that to a convenient location on your client systems and add a call 
to it in your X startup script.

#include 
#define _WIN32_WINNT 0x0500
#include 
int main()
{
   INPUT pInput[2];
   if (GetKeyState(VK_NUMLOCK) == 1)
   {
   pInput[0].type   = INPUT_KEYBOARD;
   pInput[0].ki.wVk = VK_NUMLOCK;
   pInput[0].ki.wScan   = 0;
   pInput[0].ki.dwFlags = 0; /* Nill for keydown */
   pInput[0].ki.time= 0;
   pInput[0].ki.dwExtraInfo = 0;
   pInput[1].type   = INPUT_KEYBOARD;
   pInput[1].ki.wVk = VK_NUMLOCK;
   pInput[1].ki.wScan   = 0;
   pInput[1].ki.dwFlags = KEYEVENTF_KEYUP;
   pInput[1].ki.time= 0;
   pInput[1].ki.dwExtraInfo = 0;
   if (SendInput(2, pInput, sizeof(INPUT)) == 0)
   {
   fprintf(stderr, "Error: SendInput failed.  NumLock was not 
turned off.\n");
   }
   }
}

_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.com/go/onm00200415ave/direct/01/



Re: numlock

2004-04-18 Thread J S

I Googled for "numlock off" and the first page had several 
promising-sounding hits with instructions on how to force Windows to boot 
up with NumLock off regardless of how the BIOS is configured.

The simplest solution (don't know which versions of Windows this will work 
with) was to add a line to c:\config.sys that looks like "NUMLOCK=OFF").

Thanks for your reply. Unfortunately our users' boxes are locked down 
(they're on XP) so they wouldn't be able to edit that file. I was really 
looking for a way to do this from the XFree startup script or configuration 
anyway.


Sorry to come back to this again, but I have a lot of user faults reported 
due to this problem. Our users' boxes boot up with the numlock key on so 
this causes some confusion when they are told they have to switch the 
numlock key off before starting XFree. Is there anything I can do to 
switch this numlock behaviour off without user interference?

JS.

_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger

_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.com/go/onm00200415ave/direct/01/

_
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger



Re: numlock

2004-04-17 Thread Thomas Chadwick
I Googled for "numlock off" and the first page had several 
promising-sounding hits with instructions on how to force Windows to boot up 
with NumLock off regardless of how the BIOS is configured.

The simplest solution (don't know which versions of Windows this will work 
with) was to add a line to c:\config.sys that looks like "NUMLOCK=OFF").

From: "J S" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: numlock
Date: Thu, 15 Apr 2004 09:16:19 +
Sorry to come back to this again, but I have a lot of user faults reported 
due to this problem. Our users' boxes boot up with the numlock key on so 
this causes some confusion when they are told they have to switch the 
numlock key off before starting XFree. Is there anything I can do to switch 
this numlock behaviour off without user interference?

JS.

_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger

_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.com/go/onm00200415ave/direct/01/



Re: numlock

2004-04-15 Thread J S
Sorry to come back to this again, but I have a lot of user faults reported 
due to this problem. Our users' boxes boot up with the numlock key on so 
this causes some confusion when they are told they have to switch the 
numlock key off before starting XFree. Is there anything I can do to switch 
this numlock behaviour off without user interference?

JS.

_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger



Re: numlock

2004-04-02 Thread Takuma Murakami
> Perhaps he was wondering why NumLock is turned on initially.

Cygwin/X just inherits NumLock state from Windows.
If NumLock is off when Cygwin/X is invoked, then it is also
off in the Cygwin/X.

Takuma Murakami



Re: numlock

2004-04-01 Thread Alexander Gottwald
Cary Jamison wrote:

> I think perhaps the other part of this question is why some X11 servers on
> other platforms don't treat numlock as a modifier but XFree86 does.  Could
> this be made configurable?

It's not the server which has problems but the clients. the clients should
be aware that num_lock is _not_ a normal modifier like control or shift.

This works for most clients but not for some rather old ones (twm and some
on ancient unices).

> I think this has been discussed before, though, so perhaps a search of the
> archives is in order...

You can disable the the numlock key with
xmodmap -e "remove mod2 = Num_Lock"

bye
ago
NP: Placebo - Protect Me From What I Want
-- 
 [EMAIL PROTECTED]
 http://www.gotti.org   ICQ: 126018723


Re: numlock

2004-04-01 Thread Cary Jamison
"Alexander Gottwald" <[EMAIL PROTECTED]> wrote in 
message 
news:<[EMAIL PROTECTED]>...
> On Thu, 1 Apr 2004, J S wrote:
> 
> > Ah, not the answer I was expecting! Are you pulling my leg or was that 
a 
> > serious answer?!
> 
> This is a serious answer. Numlock is treated as modifier key just like 
caps
> lock or control. pressing a key while numlock is on is just like 
pressing
> ctrl + key. 
> 

I think perhaps the other part of this question is why some X11 servers on 
other platforms don't treat numlock as a modifier but XFree86 does.  Could 
this be made configurable?

I think this has been discussed before, though, so perhaps a search of the 
archives is in order...

Cary



Re: numlock

2004-04-01 Thread Thomas Dickey
On Thu, 1 Apr 2004, Alexander Gottwald wrote:

> On Thu, 1 Apr 2004, J S wrote:
>
> > Ah, not the answer I was expecting! Are you pulling my leg or was that a
> > serious answer?!
>
> This is a serious answer. Numlock is treated as modifier key just like caps
> lock or control. pressing a key while numlock is on is just like pressing
> ctrl + key.

Perhaps he was wondering why NumLock is turned on initially.

-- 
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net


Re: numlock

2004-04-01 Thread Alexander Gottwald
On Thu, 1 Apr 2004, J S wrote:

> Ah, not the answer I was expecting! Are you pulling my leg or was that a 
> serious answer?!

This is a serious answer. Numlock is treated as modifier key just like caps
lock or control. pressing a key while numlock is on is just like pressing
ctrl + key. 

bye
ago 
-- 
 [EMAIL PROTECTED] 
 http://www.gotti.org   ICQ: 126018723


Re: numlock

2004-04-01 Thread J S
Why is it that I need to turn off the numlock key on Xfree to get the keys 
to work properly? Is this  a feature or a bug?
X11 Design feature

bye
ago
Ah, not the answer I was expecting! Are you pulling my leg or was that a 
serious answer?!

JS.

_
It's fast, it's easy and it's free. Get MSN Messenger today! 
http://www.msn.co.uk/messenger



Re: numlock

2004-04-01 Thread Alexander Gottwald
On Thu, 1 Apr 2004, J S wrote:

> Why is it that I need to turn off the numlock key on Xfree to get the keys 
> to work properly? Is this  a feature or a bug?

X11 Design feature

bye
ago
-- 
 [EMAIL PROTECTED] 
 http://www.gotti.org   ICQ: 126018723


numlock

2004-04-01 Thread J S
Why is it that I need to turn off the numlock key on Xfree to get the keys 
to work properly? Is this  a feature or a bug?

JS.

_
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger



Re: numlock

2003-02-08 Thread Thomas Chadwick
Just had a thought.  Make sure NumLock is OFF when you run the 'xmodmap -e 
"clear mod2"' command.  Otherwise, it will get stuck in the ON state.

Also, run xev and hit a keypad key other than NumLock.  If you've properly 
cleared NumLock from the keypad, all numeric keypad keypresses will have a 
state of 0x0 whether NumLock (as indicated by the status light on the 
keyboard itself) is ON or OFF.  Normally you'd get a status of 0x0 when 
NumLock is OFF and 0x10 when NumLock is ON.

From: "J S" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: numlock
Date: Fri, 07 Feb 2003 09:23:34 +

Hi Thomas,

Thanks for your reply. I get the same as you if I run xmodmap -pm. Also if 
I do: xmodmap -e "clear mod2" that clears mod2, but on the XDM login screen 
I still can't type any letters.

Here's the value of the NumLock key before clearing mod2:

KeyRelease event, serial 21, synthetic NO, window 0x61,
   root 0x36, subw 0x0, time 3663237, (570,393), root:(576,418),
   state 0x10, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,
   XLookupString gives 0 characters:  ""

Here's the value after clearing mod2:

KeyRelease event, serial 21, synthetic NO, window 0x61,
   root 0x36, subw 0x0, time 3594839, (105,139), root:(111,164),
   state 0x10, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,
   XLookupString gives 0 characters:  ""

The state value seems to be the same.

JS.


Actually, the instructions were mine, not Harold's (they were in response 
to a note from Harold).

Try this...

Start X without the NumLock modification.  In an xterm, run "xmodmap -pm". 
 You should see something that resembles the following:

xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):

shift   Shift_L (0x32),  Shift_R (0x3e)
lockCaps_Lock (0x42)
control Control_L (0x25),  Control_R (0x6d)
mod1Alt_L (0x40),  Alt_R (0x71)
mod2Num_Lock (0x4d)
mod3
mod4
mod5Scroll_Lock (0x4e)


If "Num_Lock" shows up next to something other than mod2, then you'll need 
to change what comes after "clear" when you run xmodmap.

Alternatively, you might experiment with the following scriptlet which 
tries to figure out which mod key is assigned to NumLock...

numlock=`xmodmap -pm | grep -i num_lock | awk '{print $1}'`
if [ "$numlock" != "" ]
then
 xmodmap -e "clear $numlock" ${HOME}/.Xmodmap
fi


Of course, if your NumLock key was already assigned to mod2, then I'm not 
sure what's going on.  You might want to experiment with running xev.  If 
you've cleared NumLock from the keymap, then the value of "state" inside a 
KeyPress/Release event resulting from pressing a key on the numeric keypad 
should be 0x0 regardless of whether NumLock is on or off.


From: "J S" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: numlock Date: Thu, 06 Feb 2003 10:46:58 +

Is there a way to run XFree with the numlock key on without stopping the 
keys from working? I followed the instructions from Harold's post at:

http://www.cygwin.com/ml/cygwin-xfree/2002-06/msg00307.html

but that solution didn't seem to work for me.

Thanks,

JS.



_
Surf together with new Shared Browsing 
http://join.msn.com/?page=features/browse&pgmarket=en-gb&XAPID=74&DI=1059


_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


_
Stay in touch with absent friends - get MSN Messenger 
http://messenger.msn.co.uk


_
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963



Re: numlock

2003-02-07 Thread J S
Hi Thomas,

Thanks for your reply. I get the same as you if I run xmodmap -pm. Also if I 
do: xmodmap -e "clear mod2" that clears mod2, but on the XDM login screen I 
still can't type any letters.

Here's the value of the NumLock key before clearing mod2:

KeyRelease event, serial 21, synthetic NO, window 0x61,
   root 0x36, subw 0x0, time 3663237, (570,393), root:(576,418),
   state 0x10, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,
   XLookupString gives 0 characters:  ""

Here's the value after clearing mod2:

KeyRelease event, serial 21, synthetic NO, window 0x61,
   root 0x36, subw 0x0, time 3594839, (105,139), root:(111,164),
   state 0x10, keycode 77 (keysym 0xff7f, Num_Lock), same_screen YES,
   XLookupString gives 0 characters:  ""

The state value seems to be the same.

JS.


Actually, the instructions were mine, not Harold's (they were in response 
to a note from Harold).

Try this...

Start X without the NumLock modification.  In an xterm, run "xmodmap -pm".  
You should see something that resembles the following:

xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):

shift   Shift_L (0x32),  Shift_R (0x3e)
lockCaps_Lock (0x42)
control Control_L (0x25),  Control_R (0x6d)
mod1Alt_L (0x40),  Alt_R (0x71)
mod2Num_Lock (0x4d)
mod3
mod4
mod5Scroll_Lock (0x4e)


If "Num_Lock" shows up next to something other than mod2, then you'll need 
to change what comes after "clear" when you run xmodmap.

Alternatively, you might experiment with the following scriptlet which 
tries to figure out which mod key is assigned to NumLock...

numlock=`xmodmap -pm | grep -i num_lock | awk '{print $1}'`
if [ "$numlock" != "" ]
then
 xmodmap -e "clear $numlock" ${HOME}/.Xmodmap
fi


Of course, if your NumLock key was already assigned to mod2, then I'm not 
sure what's going on.  You might want to experiment with running xev.  If 
you've cleared NumLock from the keymap, then the value of "state" inside a 
KeyPress/Release event resulting from pressing a key on the numeric keypad 
should be 0x0 regardless of whether NumLock is on or off.


From: "J S" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: numlock Date: Thu, 06 Feb 2003 10:46:58 +

Is there a way to run XFree with the numlock key on without stopping the 
keys from working? I followed the instructions from Harold's post at:

http://www.cygwin.com/ml/cygwin-xfree/2002-06/msg00307.html

but that solution didn't seem to work for me.

Thanks,

JS.



_
Surf together with new Shared Browsing 
http://join.msn.com/?page=features/browse&pgmarket=en-gb&XAPID=74&DI=1059


_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


_
Stay in touch with absent friends - get MSN Messenger 
http://messenger.msn.co.uk



Re: numlock

2003-02-06 Thread Thomas Chadwick
Actually, the instructions were mine, not Harold's (they were in response to 
a note from Harold).

Try this...

Start X without the NumLock modification.  In an xterm, run "xmodmap -pm".  
You should see something that resembles the following:

xmodmap:  up to 2 keys per modifier, (keycodes in parentheses):

shift   Shift_L (0x32),  Shift_R (0x3e)
lockCaps_Lock (0x42)
control Control_L (0x25),  Control_R (0x6d)
mod1Alt_L (0x40),  Alt_R (0x71)
mod2Num_Lock (0x4d)
mod3
mod4
mod5Scroll_Lock (0x4e)


If "Num_Lock" shows up next to something other than mod2, then you'll need 
to change what comes after "clear" when you run xmodmap.

Alternatively, you might experiment with the following scriptlet which tries 
to figure out which mod key is assigned to NumLock...

numlock=`xmodmap -pm | grep -i num_lock | awk '{print $1}'`
if [ "$numlock" != "" ]
then
 xmodmap -e "clear $numlock" ${HOME}/.Xmodmap
fi


Of course, if your NumLock key was already assigned to mod2, then I'm not 
sure what's going on.  You might want to experiment with running xev.  If 
you've cleared NumLock from the keymap, then the value of "state" inside a 
KeyPress/Release event resulting from pressing a key on the numeric keypad 
should be 0x0 regardless of whether NumLock is on or off.


From: "J S" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: numlock Date: Thu, 06 Feb 2003 10:46:58 +

Is there a way to run XFree with the numlock key on without stopping the 
keys from working? I followed the instructions from Harold's post at:

http://www.cygwin.com/ml/cygwin-xfree/2002-06/msg00307.html

but that solution didn't seem to work for me.

Thanks,

JS.



_
Surf together with new Shared Browsing 
http://join.msn.com/?page=features/browse&pgmarket=en-gb&XAPID=74&DI=1059


_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail



numlock

2003-02-06 Thread J S
Is there a way to run XFree with the numlock key on without stopping the 
keys from working? I followed the instructions from Harold's post at:

http://www.cygwin.com/ml/cygwin-xfree/2002-06/msg00307.html

but that solution didn't seem to work for me.

Thanks,

JS.



_
Surf together with new Shared Browsing 
http://join.msn.com/?page=features/browse&pgmarket=en-gb&XAPID=74&DI=1059



numlock misfunctionning

2002-08-09 Thread bitlov

Hi,

I have a belgian keyboard and I have my Numlock key that is misfunctionning
under xfree via xdmcp.
I have look the archives but I haven't found a clear solution.
When numlock is off, the keypad functions as if it was pressed but the
insert, delete, home, end, pgUp, pgDn and the arrows functions correctly.
When numlock is on, the keypad functions correctly but the insert, delete,
home, end, pgUp, pgDn and the arrows are all shifted (Shift_L).

What should I change in my xmodmap file?
Thanks,
-bitlov

Here is the xmodmap file I use.

clear Mod1
clear Mod2
keycode 8 =
keycode 9 = Escape
keycode 10 = ampersand 1 bar
keycode 11 = eacute 2 at
keycode 12 = quotedbl 3 numbersign
keycode 13 = apostrophe 4 braceleft
keycode 14 = parenleft 5
keycode 15 = section 6 asciicircum
keycode 16 = egrave 7
keycode 17 = exclam 8
keycode 18 = ccedilla 9 braceleft
keycode 19 = agrave 0 braceright
keycode 20 = parenright degree
keycode 21 = minus underscore
keycode 22 = BackSpace
keycode 23 = Tab
keycode 24 = a
keycode 25 = z
keycode 26 = e E currency
keycode 27 = r
keycode 28 = t
keycode 29 = y
keycode 30 = u
keycode 31 = i
keycode 32 = o
keycode 33 = p
keycode 34 = dead_circumflex dead_diaeresis bracketleft
keycode 35 = dollar asterisk bracketright
keycode 36 = Return
keycode 37 = Control_L
keycode 38 = q
keycode 39 = s
keycode 40 = d
keycode 41 = f
keycode 42 = g
keycode 43 = h
keycode 44 = j
keycode 45 = k
keycode 46 = l
keycode 47 = m
keycode 48 = ugrave percent dead_acute acute
keycode 49 = twosuperior threesuperior
keycode 50 = Shift_L
keycode 51 = mu sterling dead_grave grave
keycode 52 = w
keycode 53 = x
keycode 54 = c
keycode 55 = v
keycode 56 = b
keycode 57 = n
keycode 58 = comma question dead_cedilla
keycode 59 = semicolon period
keycode 60 = colon slash Multi_key
keycode 61 = equal plus dead_tilde asciitilde
keycode 62 = Shift_R
keycode 63 = KP_Multiply
keycode 64 = Alt_L
keycode 65 = space
keycode 66 = Caps_Lock
keycode 67 = F1 F11
keycode 68 = F2 F12
keycode 69 = F3 F13
keycode 70 = F4 F14
keycode 71 = F5 F15
keycode 72 = F6 F16
keycode 73 = F7 F17
keycode 74 = F8 F18
keycode 75 = F9 F19
keycode 76 = F10 F20
keycode 77 = Num_Lock
keycode 78 = Scroll_Lock
keycode 79 = KP_7 KP_Home
keycode 80 = KP_8 KP_Up
keycode 81 = KP_9 KP_Prior
keycode 82 = KP_Subtract
keycode 83 = KP_4 KP_Left
keycode 84 = KP_5 KP_Begin
keycode 85 = KP_6 KP_Right
keycode 86 = KP_Add
keycode 87 = KP_1 KP_End
keycode 88 = KP_2 KP_Down
keycode 89 = KP_3 KP_Next
keycode 90 = KP_0 KP_Insert
keycode 91 = KP_Decimal KP_Delete
keycode 92 = 0x1007ff00
keycode 93 =
keycode 94 = less greater backslash
keycode 95 = F11
keycode 96 = F12
keycode 97 = Home
keycode 98 = Up
keycode 99 = Prior
keycode 100 = Left
keycode 101 = Begin
keycode 102 = Right
keycode 103 = End
keycode 104 = Down
keycode 105 = Next
keycode 106 = Insert
keycode 107 = Delete
keycode 108 = KP_Enter
keycode 109 = Control_R
keycode 110 = Pause
keycode 111 = Print
keycode 112 = KP_Divide
keycode 113 = Mode_switch
keycode 114 = Break
keycode 116 = Mode_switch
keycode 117 = Multi_key
add Mod1 = Alt_L
add Mod2 = Mode_switch








Re: [Lesstif] Fixing the Cygwin/XFree86 mwm numlock bug

2002-07-09 Thread Danny Backx

I am not sure whether this is a bug related to XKB.

Let me explain.

To the best of my knowledge, this behaviour was present in Motif before
XKB even existed. NumLock is one of the things whose state you can track
within the set of Mwm configuration rules; my opinion is that *this* is
a bug (a design bug of Mwm, that is).

It's possible that XKB allows you to make the bug disappear. If that is so,
I don't know how; I'm not knowledgeable about XKB.

Still, your question remains valid: maybe we can use XKB to find a solution.

Danny

Harold L Hunt wrote:
> 
> I am the project leader and primary developer for the Cygwin/XFree86 project
> and the maintainer of the Cygwin setup.exe-installable Lesstif package.  I am
> extremely interested in working with you guys to figure out why one cannot
> move windows in mwm when the NumLock key is toggled on.
> 
> I have subscribed to the Lesstif mailing list for however long it takes to fix
> this bug.
> 
> I have done a search of the Lesstif mailing list and found that the problem is
> acknowledged but that someone on the Cygwin/XFree86 side was needed for
> debugging.  I searched for ``mwm cygwin site:terror.hungry.com'' at google.com:
> 
> 
>http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=mwm+cygwin+site%3Aterror.hungry.com&btnG=Google+Search
> 
> Description of the problem
> ==
> Running mwm within Cygwin/XFree86 with the NumLock key toggled on causes mwm
> windows to be unmovable with the mouse.  Toggling the NumLock key off allows
> the mwm windows to be moved.
> 
> The problem seems to arise from the fact that Cygwin/XFree86 treats NumLock as
> a modifier key, while, apparently, older versions of X11 did not consider
> NumLock to be a modifier key.
> 
> Relation to the ``kb'' extension
> 
> The kb extension is enabled in Cygwin/XFree86 by default.  I just found out,
> and I don't recall ever having been told this before, that if you run
> Cygwin/XFree86 with the ``-kb'' parameter, which disables the kb extension,
> then mwm windows are movable with the NumLock key toggled on or off.
> Essentially, the problem goes away if you turn off the kb extension.
> 
> Pondering as to what could cause the problem
> 
> I do not understand why Cygwin/XFree86 exhibits this problem, but XFree86 on
> Linux does not seem to.  As I describe below, Cygwin/XFree86 took its keyboard
> modifier setup code directly from XFree86.  Maybe XFree86 on Linux does not
> turn on the kb extension by default?
> 
> Very thorough details
> =
> Cygwin/XFree86 sets up its modifier keys in winkeybd.c/winGetKeyMappings,
> which can be viewed here:
> http://cvsweb.xfree86.org/cvsweb/xc/programs/Xserver/hw/xwin/winkeybd.c
> 
> Note that WIN_NEW_KEYBOARD_SUPPORT is currently 0, or off, so you need to skip
> the #if WIN_NEW_KEYBOARD_SUPPORT section at the top of the file.
> 
> In winGetKeyMappings we set the NumLockMask for the XK_Num_Lock key:
> case XK_Num_Lock:
>   pModMap[i] = NumLockMask;
>   break;
> 
> We copied this functionality directly from
> xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c's xf86KbdGetMapping function.
> 
> NumLockMask is defined over in
> xc/programs/Xserver/hw/xfree86/common/atKeynames.h as:
>  #define AltMaskMod1Mask
>  #define NumLockMaskMod2Mask
>  #define AltLangMaskMod3Mask
>  #define KanaMask   Mod4Mask
>  #define ScrollLockMask Mod5Mask
> 
> Of course, the ModXMasks are defined in xc/include/X.h as:
>  #define ShiftMask  (1<<0)
>  #define LockMask   (1<<1)
>  #define ControlMask(1<<2)
>  #define Mod1Mask   (1<<3)
>  #define Mod2Mask   (1<<4)
>  #define Mod3Mask   (1<<5)
>  #define Mod4Mask   (1<<6)
>  #define Mod5Mask   (1<<7)
> 
> The xkb extension also seems to have some sort of NumLockMask, over in
> xc/programs/Xserver/xkb/xkbDflts.h:
>  #definevmod_NumLockMask(1<<0)
>  #definevmod_AltMask(1<<1)
>  #definevmod_LevelThreeMask (1<<2)
>  #definevmod_AltGrMask  (1<<3)
>  #definevmod_ScrollLockMask (1<<4)
> 
> ==
> 
> Any help that the Lesstif developers can give would be greatly appreciated.  I
> have yet to come across anyone that understands fully what the xkb extension
> does and how to interface with it.  Perhap

Fixing the Cygwin/XFree86 mwm numlock bug

2002-07-09 Thread Harold L Hunt

I am the project leader and primary developer for the Cygwin/XFree86 project
and the maintainer of the Cygwin setup.exe-installable Lesstif package.  I am
extremely interested in working with you guys to figure out why one cannot
move windows in mwm when the NumLock key is toggled on.

I have subscribed to the Lesstif mailing list for however long it takes to fix
this bug.

I have done a search of the Lesstif mailing list and found that the problem is
acknowledged but that someone on the Cygwin/XFree86 side was needed for
debugging.  I searched for ``mwm cygwin site:terror.hungry.com'' at google.com:

http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=mwm+cygwin+site%3Aterror.hungry.com&btnG=Google+Search


Description of the problem
==
Running mwm within Cygwin/XFree86 with the NumLock key toggled on causes mwm
windows to be unmovable with the mouse.  Toggling the NumLock key off allows
the mwm windows to be moved.


The problem seems to arise from the fact that Cygwin/XFree86 treats NumLock as
a modifier key, while, apparently, older versions of X11 did not consider
NumLock to be a modifier key.


Relation to the ``kb'' extension

The kb extension is enabled in Cygwin/XFree86 by default.  I just found out,
and I don't recall ever having been told this before, that if you run
Cygwin/XFree86 with the ``-kb'' parameter, which disables the kb extension,
then mwm windows are movable with the NumLock key toggled on or off. 
Essentially, the problem goes away if you turn off the kb extension.


Pondering as to what could cause the problem

I do not understand why Cygwin/XFree86 exhibits this problem, but XFree86 on
Linux does not seem to.  As I describe below, Cygwin/XFree86 took its keyboard
modifier setup code directly from XFree86.  Maybe XFree86 on Linux does not
turn on the kb extension by default?


Very thorough details
=
Cygwin/XFree86 sets up its modifier keys in winkeybd.c/winGetKeyMappings,
which can be viewed here:
http://cvsweb.xfree86.org/cvsweb/xc/programs/Xserver/hw/xwin/winkeybd.c

Note that WIN_NEW_KEYBOARD_SUPPORT is currently 0, or off, so you need to skip
the #if WIN_NEW_KEYBOARD_SUPPORT section at the top of the file.

In winGetKeyMappings we set the NumLockMask for the XK_Num_Lock key:
case XK_Num_Lock:
  pModMap[i] = NumLockMask;
  break;

We copied this functionality directly from
xc/programs/Xserver/hw/xfree86/common/xf86Kbd.c's xf86KbdGetMapping function.

NumLockMask is defined over in
xc/programs/Xserver/hw/xfree86/common/atKeynames.h as:
 #define AltMaskMod1Mask
 #define NumLockMaskMod2Mask
 #define AltLangMaskMod3Mask
 #define KanaMask   Mod4Mask
 #define ScrollLockMask Mod5Mask

Of course, the ModXMasks are defined in xc/include/X.h as:
 #define ShiftMask  (1<<0)
 #define LockMask   (1<<1)
 #define ControlMask(1<<2)
 #define Mod1Mask   (1<<3)
 #define Mod2Mask   (1<<4)
 #define Mod3Mask   (1<<5)
 #define Mod4Mask   (1<<6)
 #define Mod5Mask   (1<<7)

The xkb extension also seems to have some sort of NumLockMask, over in
xc/programs/Xserver/xkb/xkbDflts.h:
 #definevmod_NumLockMask(1<<0)
 #definevmod_AltMask(1<<1)
 #definevmod_LevelThreeMask (1<<2)
 #definevmod_AltGrMask  (1<<3)
 #definevmod_ScrollLockMask (1<<4)

==

Any help that the Lesstif developers can give would be greatly appreciated.  I
have yet to come across anyone that understands fully what the xkb extension
does and how to interface with it.  Perhaps you guys know more deep magic than
we do :)

Thanks very much in advance,

Harold Hunt



Re: Development item: NumLock

2002-06-14 Thread Harold L Hunt

Alexander,

> > Is NumLock a modifier key or not?  
> 
> It Is. I know the Problem from Sun Solaris. If NumLock is on, the twm 
> buttons will not react on button presses :( 

Then why doesn't XDarwin set NumLock as a modifier key?

Harold



Re: Development item: NumLock

2002-06-14 Thread Alexander Gottwald

On Fri, 14 Jun 2002, Harold Hunt wrote:

> Is NumLock a modifier key or not?  

It Is. I know the Problem from Sun Solaris. If NumLock is on, the twm 
buttons will not react on button presses :( 

bye
ago
-- 
 [EMAIL PROTECTED] 
 http://www.gotti.org   ICQ: 126018723




Development item: NumLock

2002-06-14 Thread Harold Hunt

For anyone looking for something to do:

Take a look at how we are messing up the handling of NumLock.  For a simple
test case, install the lesstif package via Cygwin's setup.exe, run mwm.exe
as your window manager, make sure NumLock is on, then try to move a MWM
managed window.  The window won't budge.  Turn NumLock off and the window
can move freely.

It may be incorrect to treat NumLock as a 'modifier key', see
xc/programs/Xserver/hw/xwin/winkeybd.c/winGetKeyMappings (), but not
treating NumLock as a modifier key causes the NumLock key to have no effect
on whether the numerical keypad gives you numbers (NumLock on behavior) or
arrows (NumLock off behavior).  I think that both states of NumLock give you
arrows in that case.

For clues you can take a look at other servers, such as XDarwin over in
xc/programs/Xserver/hw/darwin/darwinKeyboard.c.  Notice that they use
modifier masks LockMask (CapsLock), ShiftMask, ControlMask, AltMask,
MetaMask and FunctionMask.  But they don't use NumLockMask.

What gives?  Is NumLock a modifier key or not?  If not, why doesn't it do
anything in Cygwin/XFree86 when we don't treat it as a modifier?

Hopefully that provides enough food for thought.

Good luck,

Harold




RE: Arrow key bindings and numlock

2002-06-14 Thread Virgilio, Vincent

In a previous post I mentioned that TWM was not recognizing meta (and other
state-shifting keys).  Romulus' post solved that.  Once I turned NumLock
off, the standard key bindings started working.

Thanks,

Vince Virgilio

 
If this email is not intended for you, or you are not responsible for the
delivery of this message to the addressee, please note that this message may
contain ITT Privileged/Proprietary Information.  In such a case, you may not
copy or deliver this message to anyone.  You should destroy this message and
kindly notify the sender by reply email.  Information contained in this
message that does not relate to the business of ITT is neither endorsed by
nor attributable to ITT. 
 




Arrow key bindings and numlock

2002-06-13 Thread Romulus

Hi,

Not entirely sure if this is a Cyg-XF86 concern, or an fvwm2-cyg
concern, but the research I've done so far points to problems with XF86
and NumLock.

Under XF86, I've noticed that fvwm2 doesn't correctly receive Ctl-Arrow
keys (such as Ctl-Left) if NumLock is on. For example I have defined
config lines like:
Key Up  A   C   Scroll 0 -100
and so forth. With NumLock on, X apps seem to recieve corrupted escape
strings, because I'll see ABCD's appear in an active xterm when I try
to do this. I found out that turning NumLock off made those bindings
work.

Shift bindings seem to work OK. I've seen problems in apps with meta
(alt) bindings which is probably related to the same thing.

I've seen lots of comments about at least two XF86 bugs that breaks key
bindings when numlock is on. I like numlock. Is there a happy medium?

TIA,
Kdt

__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com