From owner-freebsd-questions Sun Jul 8 14:27:34 2001 Delivered-To: freebsd-questions@freebsd.org Received: from cepheus.azstarnet.com (cepheus.azstarnet.com [169.197.56.195]) by hub.freebsd.org (Postfix) with ESMTP id A4F8037B405; Sun, 8 Jul 2001 14:27:23 -0700 (PDT) (envelope-from Castalia@azstarnet.com) Received: from azstarnet.com (dhcp1057.mc01.dsl.fastucson.net [169.197.6.35]) by cepheus.azstarnet.com (8.9.3/8.9.3) with ESMTP id OAA16786; Sun, 8 Jul 2001 14:27:08 -0700 (MST) X-Sent-via: StarNet http://www.azstarnet.com/ Message-ID: <3B48D10C.897D98DD@azstarnet.com> Date: Sun, 08 Jul 2001 14:30:52 -0700 From: Bradford Castalia Organization: idaeim X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-questions@FreeBSD.org, freebsd-java@FreeBSD.org Subject: Motif VirtualBindings for Java with XFree86 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 "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 "". 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 : KP_Enter > \nosfAddMode : ShiftF8 \nosfBackSpace : BackSpace > \nosfBeginLine : Home \nosfCancel : Escape > \nosfClear : Clear \nosfCopy : > CtrlInsert\nosfCut : ShiftDelete\nosfDelete : > Delete \nosfEndLine : End \nosfHelp : > F1 \nosfInsert : Insert \nosfLeft : > Left \nosfMenu : ShiftF10 \nosfMenuBar : > F10 \nosfPageDown : Next \nosfPageLeft : > CtrlPrior \nosfPageRight : CtrlNext \nosfPageUp : > Prior \nosfPaste : ShiftInsert\nosfPrimaryPaste:Meta > CtrlInsert\nosfRight : Right \nosfSelect : > Select \nosfUndo : Undo \nosfUp : > Up \nosfDown : Down " > > Save this to ~/.motifbind and clean it up as such: > > ! ~/.motifbind > ! This is a comment > > osfActivate : KP_Enter > osfAddMode : ShiftF8 > osfBackSpace : BackSpace > osfBeginLine : Home > osfCancel : Escape > osfClear : Clear > osfCopy : CtrlInsert > osfCut : ShiftDelete > osfDelete : Delete > osfEndLine : End > osfHelp : F1 > osfInsert : Insert > osfLeft : Left > osfMenu : ShiftF10 > osfMenuBar : F10 > osfPageDown : Next > osfPageLeft : CtrlPrior > osfPageRight : CtrlNext > osfPageUp : Prior > osfPaste : ShiftInsert > osfPrimaryPaste : Meta CtrlInsert > osfRight : Right > osfSelect : Select > osfUndo : Undo > osfUp : Up > osfDown : Down > > ! end of ~/.motifbind > > and try replacing "_Key_" with "". 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