Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rate Thread Display Modes
Old 01-26-2002, 02:46 PM   #1
santin
Triple-A Player
 
Join Date: Jan 2002
Location: Madrid
Posts: 71
XDarwin keymappings

I have recently installed XDarwin on my Spanish TiBook but I can find the correct keymapping.

Do you know how to get it or make it?
santin is offline   Reply With Quote
Old 01-26-2002, 03:30 PM   #2
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
keymapping...

Go to XDarwin preferences dialog.

Check the "Load from file" checkbox and select the keymapping file you want to load.

Restart XDarwin.

or

If you start XFree86 from the command line:

startx -- -quartz -keymap USA.keymapping (for example)

Cheers
sao is offline   Reply With Quote
Old 01-27-2002, 03:13 AM   #3
santin
Triple-A Player
 
Join Date: Jan 2002
Location: Madrid
Posts: 71
I have tried with all the keymappings, but no one seems correct for my keyboard.
santin is offline   Reply With Quote
Old 01-27-2002, 12:50 PM   #4
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
keymapping

What is your XDarwin version?
sao is offline   Reply With Quote
Old 01-27-2002, 01:30 PM   #5
santin
Triple-A Player
 
Join Date: Jan 2002
Location: Madrid
Posts: 71
XDarwin version

I am using XDarwin 1.1 (XFree86 4.2.0).
santin is offline   Reply With Quote
Old 01-27-2002, 02:21 PM   #6
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
Some time ago I read about problems with the german keymap in the fink mailing list archives.

You should post your problem there, they probably will know how to help you.

The Apple .keymap files are binary, but in X11 you could remap the keys with xmodmap and put the keymap in .xinitrc


Cheers
sao is offline   Reply With Quote
Old 01-27-2002, 02:32 PM   #7
santin
Triple-A Player
 
Join Date: Jan 2002
Location: Madrid
Posts: 71
Thank you very much for your time sao, I will try and see with the fink mailing list...
santin is offline   Reply With Quote
Old 01-27-2002, 02:52 PM   #8
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
Good luck and please let us now the result.

Cheers...
sao is offline   Reply With Quote
Old 01-27-2002, 04:03 PM   #9
santin
Triple-A Player
 
Join Date: Jan 2002
Location: Madrid
Posts: 71
Well, it seems the keymapping can be completely changed via xmodmap.
I have already been able to configure several keys (the most important ones, like / | and so on
It will take a while to configure all the wrong keys though...

I will keep you informed if I finally achieve my goal and I will post the modifications I've made...
santin is offline   Reply With Quote
Old 01-28-2002, 01:34 PM   #10
santin
Triple-A Player
 
Join Date: Jan 2002
Location: Madrid
Posts: 71
xmodmap brings a solution

xmodmap is a command that allows you to modify and customize keymaps and mouse button maps in X windows.

First thing I did was to get the current keymap table and save it as a file:
[localhost:~] santin% xmodmap -pke > .Xmodmap
The file .Xmodmap is later modified to customize the keyboard. I chose its name as it is the default for xmodmap in xinitrc.

Each line of the file is as follows:
keycode 18 = masculine ordfeminine backslash

keycode tells xmodmap you are changing a key, 18 (a number) indicates the key (18 is the one below esc in my keyboard) you want to change and then you can assign up to four symbols (keysyms): first one is the symbol that will appear if you press the key (masculine -> º); the second, when you press shift and the key (ordfeminine -> ª); the third, when you press alt (option) and the key (backslash -> \); and the fourth, when you press alt, shift and the key (nothing in this case).

All the keysyms are listed in /usr/X11R6/include/X11/keysymdef.h; however that file list the keysym and its hex value and you have to figure out the symbol (if any) that will be produced.

Know the worst part...
Using xev (running it from the command-line) opens a window where you can send xevents (as pressing a key). You simply activate the window (Event Tester) and press the key you want to test. In the terminal you run xev from, you will see the number of the key you have pressed, and the keysim and symbol it produces. With patience you can modify your .Xmodmap file changing the keys you need for example, my key number 18 was:
keycode 18 = bracketleft bracketright braceleft braceright
Which has nothing to do with the real key.

After changing the .Xmodmap file, you can load it for testing with:
[localhost:~] santin% xmodmap
And press the key in xev to see the results.

WOOAHH!!!! this is a long post, I will have to continue in the next one.
santin is offline   Reply With Quote
Old 01-28-2002, 01:38 PM   #11
santin
Triple-A Player
 
Join Date: Jan 2002
Location: Madrid
Posts: 71
xmodmap brings a solution (2)

OOOPSS, that line should have read
[localhost:~] santin% xmodmap .Xmodmap

After a while changing and trying I got a .Xmodmap file that works (more or less) correctly with my keyboard. In fact, I can now navigate through the filesystem from the terminal without pressing half of the keys (you cannot imagine how hard is to find the "/"). However, special Spanish characters don't render correctly in the terminal; though I think it has nothing to do with the keymap but with the encoding: they don't render in Terminal.app either)...
But navigating the filesystem was the most important thing...

In fact I've had a lot of fun changing the keyboard behavior and hope these two posts make sense and help everybody having a similar problem.

Now this is an extract from my .Xmodmap file, it doesn't include those lines for keys that do not have a keysym assignation. It gives the basic Spanish keyboard and still needs some work to make the keyboard exactly like it is in OS X, but it works...

keycode 8 = a A
keycode 9 = s S
keycode 10 = d D
keycode 11 = f F
keycode 12 = h H
keycode 13 = g G
keycode 14 = z Z
keycode 15 = x X
keycode 16 = c C
keycode 17 = v V
keycode 18 = masculine ordfeminine backslash
keycode 19 = b B
keycode 20 = q Q
keycode 21 = w W
keycode 22 = e E
keycode 23 = r R
keycode 24 = y Y
keycode 25 = t T
keycode 26 = 1 exclam bar
keycode 27 = 2 quotedbl at
keycode 28 = 3 periodcentered numbersign
keycode 29 = 4 dollar
keycode 30 = 6 ampersand notsign
keycode 31 = 5 percent
keycode 32 = exclamdown questiondown
keycode 33 = 9 parenright
keycode 34 = 7 slash
keycode 35 = apostrophe question
keycode 36 = 8 parenleft
keycode 37 = 0 equal
keycode 38 = plus asterisk bracketright
keycode 39 = o O
keycode 40 = u U
keycode 41 = dead_grave dead_circumflex bracketleft
keycode 42 = i I
keycode 43 = p P
keycode 44 = Return
keycode 45 = l L
keycode 46 = j J
keycode 47 = dead_acute dead_diaeresis braceleft
keycode 48 = k K
keycode 49 = ntilde Ntilde dead_tilde asciitilde
keycode 50 = ccedilla Ccedilla braceright
keycode 51 = comma semicolon
keycode 52 = minus underscore
keycode 53 = n N
keycode 54 = m M
keycode 55 = period colon
keycode 56 = Tab
keycode 57 = space
keycode 58 = less greater
keycode 59 = BackSpace
keycode 60 = KP_Enter
keycode 61 = Escape
keycode 63 = Meta_L
keycode 64 = Shift_L
keycode 65 = Caps_Lock
keycode 66 = Mode_switch
keycode 67 = Control_L
keycode 68 = Shift_R
keycode 69 = Alt_R
keycode 70 = Control_R
keycode 73 = KP_Separator
keycode 74 = NoSymbol asterisk
keycode 75 = KP_Multiply
keycode 77 = KP_Add
keycode 78 = NoSymbol plus
keycode 79 = Escape
keycode 80 = NoSymbol equal
keycode 83 = KP_Divide
keycode 84 = KP_Enter
keycode 85 = NoSymbol slash
keycode 86 = KP_Subtract
keycode 89 = KP_Equal
keycode 90 = KP_0
keycode 91 = KP_1
keycode 92 = KP_2
keycode 93 = KP_3
keycode 94 = KP_4
keycode 95 = KP_5
keycode 96 = KP_6
keycode 97 = KP_7
keycode 99 = KP_8
keycode 100 = KP_9
keycode 104 = F5
keycode 105 = F6
keycode 106 = F7
keycode 107 = F3
keycode 108 = F8
keycode 109 = F9
keycode 111 = F11
keycode 113 = F13
keycode 115 = F14
keycode 117 = F10
keycode 119 = F12
keycode 121 = F15
keycode 122 = Help
keycode 123 = Home
keycode 124 = Prior
keycode 125 = Delete
keycode 126 = F4
keycode 127 = End
keycode 128 = F2
keycode 129 = Next
keycode 130 = F1
keycode 131 = Left
keycode 132 = Right
keycode 133 = Down
keycode 134 = Up
santin is offline   Reply With Quote
Old 01-28-2002, 02:03 PM   #12
sao
Moderator
 
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
Great work...

Thanks a lot, it will become very handy for me in the future.


Cheers...

(Y ahora te doy las gracias en castellano. Muy buen trabajo, me va a venir muy bien cuando quiera cambiar mi teclado. Y lo hiciste muy rapido !!)
sao is offline   Reply With Quote
Old 01-28-2002, 02:15 PM   #13
santin
Triple-A Player
 
Join Date: Jan 2002
Location: Madrid
Posts: 71
You are welcome, sao.
I'm glad it helps.

(Es agradable leer de vez en cuando palabras amigas en castellano en este mundo en el que nos rodea el inglés...)
santin is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 05:35 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.