Final solution on using AltGr keyboard definitions with HP-UX CDE/ Motif/ X11R6 and Linux/ Cygwin

Hans Dekker hans.dekker.ext@juntadeandalucia.es
Thu Mar 18 08:29:00 GMT 2004


Hi all,

I posted some questions sometime ago on the problem of using Cygwin in
conjunction with HP-UX 11 CDE and other X-apps. Although xterm and
hpterm were working well after editing with xmodmap, dtterm and our Sas
application -which has a Motif/X11R6 interface- weren't.

After researching and finding mails from various user groups, I found
that setting the environment variable XKB_DISABLE=1 is the solution on a
HP-UX 11 platform. Setting this parameter disables Motif XKB
translations and puts Motif apps back to good old X-handling of keyboards.

My suggestion to the editors of the Cygwin manuals would be to put this
at least in the Cygwin documentation, since I saw others in your mailing
lists having this problem.

To get dtterm or your Motif/X11R6 application working well with the 
AltGr key on HP-UX 11 use:

start X environment
# XKB_DISABLE=1 dtterm
or
# XKB_DISABLE=1 <your app>

Next, you will need to reassign the AltGr key (thanks to A. Gottwald and
Philippe Auclair):

xmodmap -e "clear mod5"
xmodmap -e "clear mod3"
xmodmap -e "keycode 113 = Mode_switch Multi_key"
xmodmap -e "add mod3 = Mode_switch"

Then you can modify your keyboard further with xmodmap as desired.

For convenience I added a xmodmap.es.hpux file with the definitions for
a Spanish keyboard. It is a compilation of the definitions found in the
file /etc/X11/xkb/symbols/pc/es.

You can use xmodmap both on a terminal on your X-server as in the remote
application that is using your X-server.

Beware to use xmodmap with other X-servers like the ones of Linux or
XWin32, since those will have different keycodes mapped to the keyboard!

Following the documentation you should be able to prevent the above 
xmodmap commands, changing one of the keyboard configurations included 
with Cygwin as you like using the XF86Config file.
In my case I still needed to xmodmap keys with to use their 'third' or
AltGr definition, although others said this wouldn't be necessary and
the keyboard mapping will be brought over OK the the X-server.

I included the file /etc/X11/xkb/symbols/pc/es for a Spanish keyboard
and added the option "hpux" which defines the the keyboard using the
pc/es(basic) option, but with the Mode_switch definition of AltGr. You 
can change as you like, and make a definition for the nodeadkeys option 
for example.

Activate it in your XF86Config using:

         Option "XkbLayout"   "es"
         Option "XkbVariant"  "hpux"

         Option "LeftAlt"     "Meta"
         Option "RightAlt"    "ModeShift"												
or use this command when you don't have a XF86Config file:

# setxkbmap -layout es -variant hpux


Using Cygwin with HP-UX CDE:

When you are using CDE on HP-UX you can use the following procedure,
which I found on the Internet. Check the solution at
http://aa11.cjb.net/hpux_admin/2000/12/0212.html that came from the
community:

Create the file /etc/dt/config/Xsession.d/0050.disable_xkb with the
following content:

#!/usr/bin/ksh
#####################################################################
### File: 0050.disable_xkb
###
### Purpose: disable the XKEYBOARD extension in all R6
### client software.
#####################################################################
export XKB_DISABLE=1

and give it the 755 protection.

Then put in the .dtprofile of a user the command to change his/her
keyboard layout:

xmodmap /etc/xmodmap.es.hpux

which contains a copy of the enclosed keyboard mapping.

Again: beware to use xmodmap with other X-servers like the ones of Linux 
or XWin32, since those will have different keycodes mapped to the keyboard!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: es
Type: application/x-java-applet
Size: 2635 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-xfree/attachments/20040318/77f4b1aa/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: xmodmap.es.hpux
URL: <http://cygwin.com/pipermail/cygwin-xfree/attachments/20040318/77f4b1aa/attachment.ksh>


More information about the Cygwin-xfree mailing list