Code change required in x11drv keyboard driver

lawson_whitney at juno.com lawson_whitney at juno.com
Fri Mar 9 18:00:19 CST 2001



On Fri, 9 Mar 2001, Andy Johnson wrote:

> aAHello all. I know I'm technically a wine newby (having only just 
> installed the codeweavers preview 2) but I have a code change request.
> 
> Deep within the file ~/windows/x11drv/keyboard.c in the function 
> X11DRV_ToUnicode is the comment 'More areas where X11 returns characters 
> but Windows does not CTRL + number or CTRL + symbol'.
> 
> Whilst this is a reasonable assumption, this is in fact incorrect as 
> Windows will indeed return CTRL+symbol. Indeed if it didn't, my C++ 
> Builder Wyse120-based emulator application wouldn't be able to detect 
> and send CTRL-\ keystrokes to cKermit or CTRL-]  keystrokes to telnet 
> sessions on all my linux and unix servers.
> 
> My delight at the slick installation and configuration of preview 2 was 
> dampened when my killer app failed to return my control to Kermit. After 
> a little investigation in the source files, I traced the problem to the 
> above  function. I don't quite know whether you want to remove the 
> section entirely, but my patch runs as follows...(diff output)
> 
> 1568d1567
> <         /* Oh yes it does! - Andy Johnson */
> 1571c1570
> < /*            if (((keysym>=33) && (keysym < 'A')) ||
> ---
> >             if (((keysym>=33) && (keysym < 'A')) ||
> 1577d1575
> < */

Wow, not only can you read C code, you try and hack it.  Now if you will
just read a little bit of doco from the README... :-)

"
If you add something, or fix a bug, please send a patch ('diff -u'
format preferred) to julliard at winehq.com or to the
wine-patches at winehq.com mailing list for inclusion in the next
release.

--
Alexandre Julliard
julliard at winehq.com
"
> 
> Hope this patch is recieved in the spirit in which it is sent. Wine has 
> come so far in the last two years and whilst the goalposts are 
> constantly being moved by MS is certainly nearing an extremely 
> significant milestone. I know I can wait for Borland to produce a C++ 
> version of Kylix and then port my app over to native linux but in the 
> short term Wine is the only method I can use to get my app onto Linux 
> and away from dual-booting.
> 
> Andy Johnson
> 
If you think about it a little, you can see why diff -u format is
preferable for such a large and distributed project as Wine, where the
particular copy you are changing might not be exactly the same version I
am using.  Also, it is easier to apply a patch that says in the patch
which file it is patching.  And I had to use --reverse to apply yours.
:-).  See if the one I attach doesn't look better.

Maybe you would like to offer it on wine-patches.  Maybe whoever put
that code in can come up with a reason some app needs to be protected
from seeing control-]; maybe it is a win16/win32 thing or there is some
filter or some other thing we don't know about in that big ugly API...

Dont forget a ChangeLog entry.  See <wine>/ChangeLog to see what is a
ChangeLog entry, or subscribe to wine-patches for a little while and you
will see some.

Lawson

panic: detected rogue system administrator!!
---cut here
-------------- next part --------------
diff -ur was/windows/x11drv/keyboard.c is/windows/x11drv/keyboard.c
--- was/windows/x11drv/keyboard.c	Mon Mar  5 23:47:15 2001
+++ is/windows/x11drv/keyboard.c	Fri Mar  9 14:10:50 2001
@@ -1565,6 +1565,7 @@
     else {  /* ret != 0 */
         /* We have a special case to handle : Shift + arrow, shift + home, ...
            X returns a char for it, but Windows doesn't. Let's eat it. */
+        /* Oh yes it does! - Andy Johnson */
         if (!(e.state & NumLockMask)  /* NumLock is off */
             && (e.state & ShiftMask) /* Shift is pressed */
             && (keysym>=XK_KP_0) && (keysym<=XK_KP_9))
@@ -1577,12 +1578,13 @@
            CTRL + number or CTRL + symbol*/
         if (e.state & ControlMask)
         {
-            if (((keysym>=33) && (keysym < 'A')) ||
+/*            if (((keysym>=33) && (keysym < 'A')) ||
                 ((keysym > 'Z') && (keysym < 'a')))
             {
                 *(char*)lpChar = 0;
                 ret = 0;
             }
+*/
         }
 
         /* We have another special case for delete key (XK_Delete) on an


More information about the wine-users mailing list