This is a follow-up from almost a year ago.

When I recently switched to JDK1.4 and Redhat 7.3, I started to receive 
warnings when I started Java Swing applications in the form of:

Warning: Cannot convert string "<Key>Escape,_Key_Cancel" to type 
VirtualBinding

I found an old post on the xpert list that reported to solve the 
problem, but it didn't. After mailing the original solution provider 
([EMAIL PROTECTED]), he pointed out that the solution has changed 
slightly. I am reposting his new solution here (slightly edited) in hope 
that it will help other people.

-> richard

----------------

Note that I am using FreeBSD 4.5-STABLE, so I can not comment on differences with the 
Red Hat Linux distribution.

I'm going to assume that you are using XFree86 version 4.2.0 or greater. The reason 
that I am making this assumption is that I found, after upgrading XFree86 from version 
4.0.2 to 4.2.0, my fix did not work as before. I found that the XFree86 maintainers 
had omitted a necessary section from the lib/X11/config/Motif.tmpl file in config 
directory of the XFree86 installation (typically located in /usr/X11R6):

#ifndef VirtualBindingsPath
/*  Modified for XFree86 (Castalia 2/02)
# define VirtualBindingsPath /usr/lib/Xm/bindings
*/
# define VirtualBindingsPath /usr/X11R6/lib/X11/bindings
#endif

[The above modified version of the configuration information is] obviously important 
for finding the virtual bindings definitions. In the lib/X11/bindings directory of the 
XFree86 installation, modify the xmbind.alias file as before by adding this line (I 
put it right at the top of the alias list):

"The XFree86 Project, Inc"      XFree86

The portion in double quotes is the string that the X server uses to identify the 
vendor of the software. I find this in the server startup log file 
(/var/log/XFree86.0.log on my system [):

(II) Module scanpci: vendor="The XFree86 Project"

The key is exactly what follows vendor=; since you are using XFree86 I assume this 
will be the same as it is for me. In the xmbind.alias file, the identifier after the 
vendor string (i.e., XFree86) is the name of a file in the same directory containing 
the virtual bindings definitions. You should be able to name this file whatever seems 
appropriate to you; XFree86 seems obvious to me (I don't understand why it isn't 
obvious to the folks distributing XFree86 ;-).

I chose to copy the sun_at file in the same directory to be my XFree86; but I don't 
remember why other than it worked. I'm using a straightforward keyboard (Key Tronic LT 
Designer) so your needs may vary depending on the keyboard specifics. I do remember 
digging a bit into the osfXXX definitions in the virtual bindings definitions files 
and it seems that osfCancel is the virtual name that is bound to the <Key>Escape 
(where "Escape" is the name for a specific key code) emitted from your keyboard. Of 
course, if the sun_at bindings don't work for you, trying some other file (or rolling 
your own) probably will.

The key (excuse the pun :^) seems to be telling the XFree86 X server where to find the 
virtual bindings (which file in which directory), and then configuring the bindings 
appropriate to your keyboard.

In all fairness to the XFree86 folks, I suspect that the reason they do not 
pre-configure this stuff is that it is virtually (oops!) never needed. Only the Java 
installation on my system has ever complained.

Brad Castalia

P.S. Would you please report this, along with your final solution, as an update to the 
"VirtualBindings" thread of the Xpert list on the XFree86 site so others will know the 
solution, too.


Reply via email to