A patch for src/solaris/classes/sun/awt/X11/XKeysym.java

Max (Weijun) Wang Weijun.Wang at Sun.COM
Tue Jan 20 22:25:39 PST 2009


> to resolve the issues. One work-around can be found here though:
>
> http://extrabright.com/blog/2007/02/03/better-keyboard-shortcut-for-mac-x11-apps/

This workaround maps both Meta keys to Ctrl, which might be good for  
OpenOffice (the X11 version) where only Ctrl-X keyboard shortcuts are  
defined. In NetBeans, both Meta-X and Ctrl-X keys are defined, and you  
lost the function of Meta+X after this match. For example, both Ctrl-G  
and Meta-G are now "Go to Line".

Thanks
Max

On Jan 21, 2009, at 11:49 AM, Kurt Miller wrote:

> Hi Max,
>
> I too am not an X11/awt expert. I looked over the patch and some
> of the related code. 16 == XConstants.Mod2Mask, but looking at
>
> src/solaris/classes/sun/awt/X11/XToolkit.java
>
> makes me believe hard-coding it here is not correct. On my system
> mod2 is NumLock but on OS X it is Command (use xmodmap -p to check).
> To further complicate things XK_Meta_L is Alt normally but on OS X
> it is the Command key.  I'm not sure of the correct solution to use
> to resolve the issues. One work-around can be found here though:
>
> http://extrabright.com/blog/2007/02/03/better-keyboard-shortcut-for-mac-x11-apps/
>
> Regards,
> -Kurt
>
> Max (Weijun) Wang wrote:
>> Hi, BSD Hackers
>>
>> I'm using the bsd-port openjdk to run NetBeans on my MacBook. There's
>> a problem that when you press Command+X in the editor, besides the
>> keyboard shortcut being executed, the letter "X" itself goes into the
>> edited file.
>>
>> I've coined the following patch and at least NetBeans works fine now.
>>
>> diff --git a/src/solaris/classes/sun/awt/X11/XKeysym.java b/src/
>> solaris/classes/sun/awt/X11/XKeysym.java
>> --- a/src/solaris/classes/sun/awt/X11/XKeysym.java
>> +++ b/src/solaris/classes/sun/awt/X11/XKeysym.java
>> @@ -70,7 +70,7 @@
>>          /* First check for Latin-1 characters (1:1 mapping) */
>>          if ((ks >= 0x0020 && ks <= 0x007e) ||
>>              (ks >= 0x00a0 && ks <= 0x00ff)) {
>> -            if( (state & XConstants.ControlMask) != 0 ) {
>> +            if( (state & XConstants.ControlMask) != 0 || (state &
>> 16) != 0 ) {
>>                  if ((ks >= 'A' && ks <= ']') || (ks == '_') ||
>>                      (ks >= 'a' && ks <='z')) {
>>                      ks &= 0x1F;
>>
>> I'm neither a BSD nor an X11/awt expert, so I'm completely not sure  
>> if
>> this really fixes the problem or has broken other things.
>>
>> Thanks
>> Max
>>
>>
>




More information about the bsd-port-dev mailing list