Date: Sun, 08 Jul 2001 14:30:52 -0700 From: Bradford Castalia <Castalia@azstarnet.com> To: freebsd-questions@FreeBSD.org, freebsd-java@FreeBSD.org Subject: Motif VirtualBindings for Java with XFree86 Message-ID: <3B48D10C.897D98DD@azstarnet.com>
next in thread | raw e-mail | index | archive | help
This email will be of interest to anyone using the Sun Java distribution with XFree86 on FreeBSD: -------- Original Message -------- Subject: Re: [Xpert]VirtualBindings Date: Sun, 08 Jul 2001 14:16:38 -0700 The reply from Chuck Slivkoff to my query seeking a solution to the VirtualBindings problem is similar to many other responses to this problem query that I have found out on the internet. The basic thrust is to provide additional Motif virtual key bindings to satisfy the expectations of the application. After a lot of investigation and trial and error I have discovered that, while the basic idea is correct, the solution is much simpler. As described in the VirtualBindings(3) man page, Motif describes key translations in terms of virtual bindings that are stored in the X server as the _MOTIF_DEFAULT_BINDINGS resource, as Chuck Slivkoff shows below. This resource is defined by the first Motif application that runs (i.e. if it is not already set) using information found by a search for well-known files. As Chuck Slivkoff points out ~/.motifbind is one of these files and provides individual user control. If no files are found in the search Motif loads a set of hard-coded fallback bindings. One of the files that is sought, however, is the system-wide xmbind.alias file which can be found in the /usr/X11R6/lib/X11/bindings directory of the XFree86 distribution (note: this is different than the location specified in the VirtualBindings man page; /usr/lib/Xm/bindings). This xmbind.alias file maps the vendor string of the X server (run xdpyinfo to see it) to the name of a file containing the appropriate virtual bindings definitions (they are in the same directory). Unfortunately, the XFree86 distribution does not contain an entry for the XFree86 server in this file (! an easy to miss oversight that will probably be fixed in future releases :-). So edit this file and add this line (the file contains a clear description of the format): "The XFree86 Project, Inc" XFree86 The provide the file named XFree86 in the same directory by copying one of the other virtual bindings definitions files. I used the sun_at file. Then restart the X server. Note that the xmbind utility can be used to set the appropriate virtual bindings. For example, "xmbind /usr/X11R6/lib/X11/bindings/sun_at" will do the job. But the xmbind.alias file should be updated to provide a permanent fix. -- Bradford Castalia Castalia@azstarnet.com Systems Analyst http://azstarnet.com/~castalia idaeim 520-624-6629 "Build an image in your mind, fit yourself into it." The Log of Cyradis, Seeress of Kell. Chuck Slivkoff wrote: > > Bradford Castalia wrote: > > > > On a FreeBSD system (4.2-STABLE, i386) using XFree86 4.0.2 I have > > installed the Sun JDK (1.3.1) Java distribution. This works fine > > (with the -classic JVM). However, when running Java GUI aps I am > > plagued by this annoying, but otherwise seemingly inoffensive, > > sequence of warning messages on startup: > > > > Warning: Cannot convert string "<Key>Escape,_Key_Cancel" to > > type VirtualBinding > > [snip] > > IIRC, the first Motif client started is responsible for loading a > keybinding property to the root window if one does not already exist. > I'm not sure on the exact order, but I believe Motif looks for > ~/.motifbind, $XMBINDDIR and then a compiled-in default. The X server > vendor string also has an influence. > > One of the causes of the warning messages is when there are unrecognized > keysyms specified. I think the problem could be that the "_Key_" should > really be "<Key>". Here's a possible workaround. > > Check your root-window properties (xprop -root) for something like > _MOTIF_DEFAULT_BINDINGS: > > $ xprop -root |grep -i bind > _MOTIF_DEFAULT_BINDINGS(STRING) = "osfActivate : <Key>KP_Enter > \nosfAddMode : Shift<Key>F8 \nosfBackSpace : <Key>BackSpace > \nosfBeginLine : <Key>Home \nosfCancel : <Key>Escape > \nosfClear : <Key>Clear \nosfCopy : > Ctrl<Key>Insert\nosfCut : Shift<Key>Delete\nosfDelete : > <Key>Delete \nosfEndLine : <Key>End \nosfHelp : > <Key>F1 \nosfInsert : <Key>Insert \nosfLeft : > <Key>Left \nosfMenu : Shift<Key>F10 \nosfMenuBar : > <Key>F10 \nosfPageDown : <Key>Next \nosfPageLeft : > Ctrl<Key>Prior \nosfPageRight : Ctrl<Key>Next \nosfPageUp : > <Key>Prior \nosfPaste : Shift<Key>Insert\nosfPrimaryPaste:Meta > Ctrl<Key>Insert\nosfRight : <Key>Right \nosfSelect : > <Key>Select \nosfUndo : <Key>Undo \nosfUp : > <Key>Up \nosfDown : <Key>Down " > > Save this to ~/.motifbind and clean it up as such: > > ! ~/.motifbind > ! This is a comment > > osfActivate : <Key>KP_Enter > osfAddMode : Shift<Key>F8 > osfBackSpace : <Key>BackSpace > osfBeginLine : <Key>Home > osfCancel : <Key>Escape > osfClear : <Key>Clear > osfCopy : Ctrl<Key>Insert > osfCut : Shift<Key>Delete > osfDelete : <Key>Delete > osfEndLine : <Key>End > osfHelp : <Key>F1 > osfInsert : <Key>Insert > osfLeft : <Key>Left > osfMenu : Shift<Key>F10 > osfMenuBar : <Key>F10 > osfPageDown : <Key>Next > osfPageLeft : Ctrl<Key>Prior > osfPageRight : Ctrl<Key>Next > osfPageUp : <Key>Prior > osfPaste : Shift<Key>Insert > osfPrimaryPaste : Meta Ctrl<Key>Insert > osfRight : <Key>Right > osfSelect : <Key>Select > osfUndo : <Key>Undo > osfUp : <Key>Up > osfDown : <Key>Down > > ! end of ~/.motifbind > > and try replacing "_Key_" with "<Key>". Then close all your Motif > applications, "xprop -remove" the property, then restart. > > If that doesn't help, you might try using the example above. > > -chuck To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B48D10C.897D98DD>