MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Linux,German Keybord #1 : Massive Key Problems

  • To: mathgroup at smc.vnet.net
  • Subject: [mg3856] Re: [mg3795] Linux,German Keybord #1 : Massive Key Problems
  • From: Timo Felbinger <felbing at spock.physik.uni-konstanz.de>
  • Date: Sat, 4 May 1996 02:12:31 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Andreas Steffan wrote:
>I'm using a "PC 102 key keyboard #1 (Linux/XFree86 German layout) keyboard",
>and I wonder why I can't make "Mode_switch (0x71)" become the Modifier 2.
>Therefore I can't generate "[","]","{" etc. in the XFrontend under Linux.
>This is really annoying, making the XFrontend unusuable. =:-(
>In "X Environment Information" I tried the following settings:

This seems to be a common problem to German users of Mathematica for Linux; I and a  
friend of mine experienced exactly the same problem.
We asked WRI's support hotline for assistance; in the time it took them to respond,  
I found a solution on my own, so I can suggest two quite different solutions:

This is the original reply of WRI:

============(citation starts here)================

1. Use the program "xev" to find out the keysym names for the
characters to be configured.

For Example:

character	keysym
---------	---------
{	braceleft
[	bracketleft
]	bracketright
}	braceright

2. Now decide which key will be mapped to which characters.  Here, I
use the Alt_GR key with the characters "7", "8", "9", and "0", to
produce "{", "[", "]" and "}", respectively.

3. Select the "X Environment Information" option from the Mathematica
"Help" menu, and use the "Find Keys and Modifiers" option to find out
which Mod key the Alt_GR key is set to. In this example Alt_GR key is
set to Mod2 - if it is not currently set to any Mod key you can set it
here.

4. Add a line to the XMathematica file in the ~Mathematica/FrontEnd
directory or in your home directory, if you have copied this file to
your home directory, for each key. Currently the file will have an
entry like

*Notebook.translations: #override \n\
<Btn1Up>: selection-put() \n\
<Btn1Down>: selection-get()

The new lines can be added as follows:

*Notebook.translations: #override \n\
<Btn1Up>: selection-put() \n\
<Btn1Down>: selection-get() \n\
Mod2<Key>7: key("braceleft") \n\
Mod2<Key>8: key("bracketleft") \n\
Mod2<Key>9: key("bracketright") \n\
Mod2<Key>0: key("braceright")

This should set the key combinations Alt_GR + "7", "8", "9" and "0" to
be the characters "{", "[", "]" and "}".


Let me know if I can be of further assistance.

Tom Zeller
Wolfram Research Technical Support - Student Versions

=================(end of citation)====================================

I didn't try this approach, but it looks quite plausible.

The same problem can also be solved by adjusting your keyboard mappings via  
xmodmap; call xmodmap (for convenience, insert the call into your .xinitrc) with an  
input file containing the following lines:

======================(cut here)======================================
keycode 0x10 =	7 slash	braceleft NoSymbol NoSymbol braceleft
keycode 0x11 =	8 parenleft bracketleft	NoSymbol NoSymbol bracketleft
keycode 0x12 =	9 parenright bracketright NoSymbol NoSymbol bracketright
keycode 0x13 =	0 equal	 braceright NoSymbol NoSymbol braceright
keycode 0x14 =	ssharp	question backslash NoSymbol NoSymbol	backslash

keycode 0x18 =	q Q at NoSymbol NoSymbol at
keycode 0x23 =	plus	asterisk asciitilde NoSymbol NoSymbol	asciitilde

keycode 0x2F =	odiaeresis Odiaeresis braceleft	NoSymbol NoSymbol braceleft
keycode 0x30 =	adiaeresis Adiaeresis braceright NoSymbol NoSymbol braceright

keycode 0x5E =	less greater	bar NoSymbol NoSymbol bar

keycode 0x40 =	Meta_L
keycode 0x71 =	Alt_R

clear Shift
clear Lock
clear Control
clear Mod1
clear Mod2
clear Mod3
clear Mod4
clear Mod5

add    Shift   = Shift_L Shift_R
add    Lock    = Caps_Lock
add    Control = Control_L Control_R
add    Mod1    = Meta_L
add    Mod2    = Alt_R Mode_switch
add    Mod5    = Scroll_Lock

======================(cut here)==============================================

If you are already using some modified keyboard mapping, you can use xkeycaps to  
output your current settings to a file, add or modify the above lines in this file,  
and then use it as input to xmodmap.

This will turn the left Alt-key into a Meta-Key (in the sense of Emacs), and at the  
same time a Mod1-key (in the sense of Mathematica). The right Alt_GR-key becomes an  
Alt-key (in Emacs) and a Mod2-key (in Mathematica), and it will produce within
Mathematica all characters which are normally entered using Alt_GR on a German  
keyboard (unless I forgot one of them). The curly brackets can also be entered as  
Alt_GR-oe and Alt_GR-ae (German umlaute oe and ae), which I find much more  
convenient than Alt_GR-7 and Alt_GR-0.

The drawback is that you have to teach emacs to accept "{", "[" and so on via Alt  
instead of ModeSwitch; I haven't done this yet, but it should not be a problem. In  
exchange, this will give you Alt as an additional modifier (besides Control and  
Meta) within emacs.

I have not yet tried to get all these special German characters to work within  
Mathematica; actually, I don't really miss them.

  Timo Felbinger
  timo.felbinger at uni-konstanz.de


==== [MESSAGE SEPARATOR] ====


  • Prev by Date: MathLink and Pascal ?
  • Next by Date: Re: Help on Function
  • Previous by thread: Re: MathLink and Pascal ?
  • Next by thread: Employment Opportunity: Mathematica Education Specialist