Re: X keyboard model [was Re: AbiWord.Unicode.clue++]

Drazen Kacar (dave@srce.hr)
Sun, 21 Mar 1999 16:17:36 +0100


--MGYHOYXEY6WxJCY8
Content-Type: text/plain; charset=us-ascii

Jeff Hostetler wrote:

> wow! and i thought i was confused before....

Nobody really understands X keyboard model. Don't be depressed :-)

> let me see if i understand: on your keyboard, the left ALT key
> (keysym ALT_L) is reported as the Mod4 modified. and the Meta
> keys (keysyms Meta_L & Meta_R) are reported as the Mod1 modifier.

Sun's keyboards are notorius. This is not a default, though. I've
set it the way I want it. IIRC, X spec says that ALT key is
identified by having one of the modifier bits and either Alt_L
or Alt_R KeySym associated with it. The same goes for Meta.

I didn't write anything about handling Compose characters before.
There are two reasons for this. First, on every system I've seen,
that works with Latin 1 only. Second, the whole concept is ridiculous,
because you have to press 3 keys to get one character. It's only
good if you're writing in two languages at the same time, so your
keyboard probably won't have enough keys for both.

This is the physical layout of the last row on my keyboard (with
the inscriptions on the keys):

<Caps Lock><Alt><Meta><Space><Meta><Compose><Alt Graph>

Keys I've marked with Meta actually have a diamond sign written on
them (something like <>).

I don't even know if the defaults are the same for CDE and
Open Windows. And it's very likely that various L10N settings
have different KeySyms and modifiers by default.

> it was my intention to only support 'shift', 'control' and 'alt',
> so no i hadn't planned anything for Meta (or Super or Hyper :-)

I thought so, but X spec says that ALT is not "whichever key that
happens to have Mod1 associated :-).

> could you send me the output of 'xmodmap -pk' and 'xmodmap -pke'
> -- i'd like to see how they compare with my system.

They are in the attachements, although I'll probably change some
of that RSN. If you want the default settings, let me know. Just don't
ask me to give you the settings for each L10N environment. Login
scripts are messing with keys in a strange (and sometimes utterly
broken) ways. That is a keyboard localized by me, since Sun's Croatian
localization is completely useless.

> also, could you try a small code mod for me? take a look at
> abi/src/ev/unix/ev_UnixKeyboard.cpp. search for 'MOD1'. right
> after the:
> if (e->state & GDK_MOD1_MASK)
> state |= EV_EMS_ALT;
> could you add:
> if (e->state & GDK_MOD4_MASK)
> state |= EV_EMS_ALT;
>
> and see if everything works as it should. with this both ALT and META
> should behave identically.

They do. However, that's only because today I happen to have Mod4 on Meta.
Tomorrow it might be Mod3. I think you should (on startup) ask X server
about the keys which have Alt_L, ALt_R, Meta_L and Meta_R KeySyms and
then pick up Mod flags from them. So it will all work untill I decide
to write something in Franch. Then I'll click on a certain icon and
the keyboard would change completely. But, there is an X event to
catch when this happens, I think. Yes, I hate X keyboard model, too. :-)

-- 
 .-.   .-.    Life is a sexually transmitted disease.
(_  \ /  _)
     |        dave@srce.hr
     |        dave@fly.cc.fer.hr

--MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=xmodmap-pk

There are 5 KeySyms per KeyCode; KeyCodes range from 8 to 132.

KeyCode Keysym (Keysym) ... Value Value (Name) ...

8 0xffc8 (F11) 0xffc8 (F11) 0xff69 (Cancel) 9 0x1005ff77 (SunAudioLowerVolume) 0x1005ff7b (SunVideoLowerBrightness) 10 0xffc9 (F12) 0xffc9 (F12) 0xff66 (Redo) 11 0x1005ff79 (SunAudioRaiseVolume) 0x1005ff7c (SunVideoRaiseBrightness) 12 0xffbe (F1) 13 0xffbf (F2) 14 0xffc7 (F10) 15 0xffc0 (F3) 16 0x1005ff10 (SunF36) 17 0xffc1 (F4) 18 0x1005ff11 (SunF37) 19 0xffc2 (F5) 20 0xffe8 (Meta_R) 21 0xffc3 (F6) 22 23 0xffc4 (F7) 24 0xffc5 (F8) 25 0xffc6 (F9) 26 0xffe9 (Alt_L) 27 0xff52 (Up) 28 0xffd2 (F21) 0xffd2 (F21) 0xff13 (Pause) 0xff6b (Break) 29 0xffd3 (F22) 0xffd3 (F22) 0xff61 (Print) 0x1005ff60 (SunSys_Req) 30 0xffd4 (F23) 0xffd4 (F23) 0xff14 (Scroll_Lock) 31 0xff51 (Left) 32 0xffca (F13) 0xffca (F13) 0x1005ff70 (SunProps) 33 0xffcb (F14) 0xffcb (F14) 0xff65 (Undo) 34 0xff54 (Down) 35 0xff53 (Right) 36 0xff1b (Escape) 37 0x0031 (1) 0x0021 (exclam) 38 0x0032 (2) 0x0040 (at) 39 0x0033 (3) 0x0023 (numbersign) 40 0x0034 (4) 0x0024 (dollar) 0x00a4 (currency) 41 0x0035 (5) 0x0025 (percent) 0x00a4 (currency) 42 0x0036 (6) 0x005e (asciicircum) 43 0x0037 (7) 0x0026 (ampersand) 44 0x0038 (8) 0x002a (asterisk) 45 0x0039 (9) 0x0028 (parenleft) 46 0x0030 (0) 0x0029 (parenright) 47 0x002d (minus) 0x005f (underscore) 48 0x003d (equal) 0x002b (plus) 49 0x0060 (grave) 0x007e (asciitilde) 0x00be (threequarters) 0x00ae (registered) 50 0xff08 (BackSpace) 51 0xff63 (Insert) 52 0x1005ff78 (SunAudioMute) 0x1005ff7a (SunVideoDegauss) 53 0xffd6 (F25) 0xffd6 (F25) 0xffaf (KP_Divide) 54 0xffd7 (F26) 0xffd7 (F26) 0xffaa (KP_Multiply) 55 0x1005ff76 (SunPowerSwitch) 0x1005ff7d (SunPowerSwitchShift) 56 0xffcc (F15) 0xffcc (F15) 0x1005ff71 (SunFront) 57 0xffff (Delete) 0xffff (Delete) 0xffae (KP_Decimal) 58 0xffcd (F16) 0xffcd (F16) 0x1005ff72 (SunCopy) 59 0xff50 (Home) 60 0xff09 (Tab) 61 0x0051 (Q) 62 0x0057 (W) 63 0x0065 (e) 0x0045 (E) 0x00a4 (currency) 64 0x0052 (R) 65 0x0054 (T) 66 0x0059 (Y) 67 0x0055 (U) 68 0x0049 (I) 69 0x004f (O) 70 0x0050 (P) 71 0x005b (bracketleft) 0x007b (braceleft) 0x00b9 (onesuperior) 0x00a9 (copyright) 72 0x005d (bracketright) 0x007d (braceright) 0x00f0 (eth) 0x00d0 (ETH) 73 0xffff (Delete) 74 0xff20 (Multi_key) 75 0xffd8 (F27) 0xffd8 (F27) 0xffb7 (KP_7) 0xff50 (Home) 76 0xff52 (Up) 0xffd9 (F28) 0xffb8 (KP_8) 77 0xffda (F29) 0xffda (F29) 0xffb9 (KP_9) 0xff55 (Prior) 78 0xffd5 (F24) 0xffd5 (F24) 0xffad (KP_Subtract) 79 0xffce (F17) 0xffce (F17) 0x1005ff73 (SunOpen) 80 0xffcf (F18) 0xffcf (F18) 0x1005ff74 (SunPaste) 81 0xff57 (End) 82 83 0xffe3 (Control_L) 84 0x0041 (A) 85 0x0053 (S) 86 0x0044 (D) 87 0x0046 (F) 88 0x0047 (G) 89 0x0048 (H) 90 0x004a (J) 91 0x004b (K) 92 0x004c (L) 93 0x003b (semicolon) 0x003a (colon) 0x00e8 (egrave) 0x00c8 (Egrave) 94 0x0027 (apostrophe) 0x0022 (quotedbl) 0x00e6 (ae) 0x00c6 (AE) 95 0x005c (backslash) 0x007c (bar) 0x00a6 (brokenbar) 96 0xff0d (Return) 97 0xff8d (KP_Enter) 98 0xff51 (Left) 0xffdb (F30) 0xffb4 (KP_4) 99 0xffdc (F31) 0xffdc (F31) 0xffb5 (KP_5) 100 0xff53 (Right) 0xffdd (F32) 0xffb6 (KP_6) 101 0xff9e (KP_Insert) 0xff9e (KP_Insert) 0xffb0 (KP_0) 102 0xffd0 (F19) 0xffd0 (F19) 0xff68 (Find) 103 0xff55 (Prior) 104 0xffd1 (F20) 0xffd1 (F20) 0x1005ff75 (SunCut) 105 0xff7f (Num_Lock) 106 0xffe1 (Shift_L) 107 0x005a (Z) 108 0x0058 (X) 109 0x0043 (C) 110 0x0056 (V) 111 0x0042 (B) 112 0x004e (N) 113 0x004d (M) 114 0x002c (comma) 0x003c (less) 115 0x002e (period) 0x003e (greater) 116 0x002f (slash) 0x003f (question) 117 0xffe2 (Shift_R) 118 119 0xffde (F33) 0xffde (F33) 0xffb1 (KP_1) 0xff57 (End) 120 0xff54 (Down) 0xffdf (F34) 0xffb2 (KP_2) 121 0xffe0 (F35) 0xffe0 (F35) 0xffb3 (KP_3) 0xff56 (Next) 122 123 124 125 0xff6a (Help) 126 0xffe5 (Caps_Lock) 127 0xffe7 (Meta_L) 128 0x0020 (space) 129 0xff7e (Mode_switch) 130 0xff56 (Next) 131 132 0xffab (KP_Add)

--MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=xmodmap-pke

keycode 8 = F11 F11 Cancel keycode 9 = SunAudioLowerVolume SunVideoLowerBrightness keycode 10 = F12 F12 Redo keycode 11 = SunAudioRaiseVolume SunVideoRaiseBrightness keycode 12 = F1 keycode 13 = F2 keycode 14 = F10 keycode 15 = F3 keycode 16 = SunF36 keycode 17 = F4 keycode 18 = SunF37 keycode 19 = F5 keycode 20 = Meta_R keycode 21 = F6 keycode 22 = keycode 23 = F7 keycode 24 = F8 keycode 25 = F9 keycode 26 = Alt_L keycode 27 = Up keycode 28 = F21 F21 Pause Break keycode 29 = F22 F22 Print SunSys_Req keycode 30 = F23 F23 Scroll_Lock keycode 31 = Left keycode 32 = F13 F13 SunProps keycode 33 = F14 F14 Undo keycode 34 = Down keycode 35 = Right keycode 36 = Escape keycode 37 = 1 exclam keycode 38 = 2 at keycode 39 = 3 numbersign keycode 40 = 4 dollar currency keycode 41 = 5 percent currency keycode 42 = 6 asciicircum keycode 43 = 7 ampersand keycode 44 = 8 asterisk keycode 45 = 9 parenleft keycode 46 = 0 parenright keycode 47 = minus underscore keycode 48 = equal plus keycode 49 = grave asciitilde threequarters registered keycode 50 = BackSpace keycode 51 = Insert keycode 52 = SunAudioMute SunVideoDegauss keycode 53 = F25 F25 KP_Divide keycode 54 = F26 F26 KP_Multiply keycode 55 = SunPowerSwitch SunPowerSwitchShift keycode 56 = F15 F15 SunFront keycode 57 = Delete Delete KP_Decimal keycode 58 = F16 F16 SunCopy keycode 59 = Home keycode 60 = Tab keycode 61 = Q keycode 62 = W keycode 63 = e E currency keycode 64 = R keycode 65 = T keycode 66 = Y keycode 67 = U keycode 68 = I keycode 69 = O keycode 70 = P keycode 71 = bracketleft braceleft onesuperior copyright keycode 72 = bracketright braceright eth ETH keycode 73 = Delete keycode 74 = Multi_key keycode 75 = F27 F27 KP_7 Home keycode 76 = Up F28 KP_8 keycode 77 = F29 F29 KP_9 Prior keycode 78 = F24 F24 KP_Subtract keycode 79 = F17 F17 SunOpen keycode 80 = F18 F18 SunPaste keycode 81 = End keycode 82 = keycode 83 = Control_L keycode 84 = A keycode 85 = S keycode 86 = D keycode 87 = F keycode 88 = G keycode 89 = H keycode 90 = J keycode 91 = K keycode 92 = L keycode 93 = semicolon colon egrave Egrave keycode 94 = apostrophe quotedbl ae AE keycode 95 = backslash bar brokenbar keycode 96 = Return keycode 97 = KP_Enter keycode 98 = Left F30 KP_4 keycode 99 = F31 F31 KP_5 keycode 100 = Right F32 KP_6 keycode 101 = KP_Insert KP_Insert KP_0 keycode 102 = F19 F19 Find keycode 103 = Prior keycode 104 = F20 F20 SunCut keycode 105 = Num_Lock keycode 106 = Shift_L keycode 107 = Z keycode 108 = X keycode 109 = C keycode 110 = V keycode 111 = B keycode 112 = N keycode 113 = M keycode 114 = comma less keycode 115 = period greater keycode 116 = slash question keycode 117 = Shift_R keycode 118 = keycode 119 = F33 F33 KP_1 End keycode 120 = Down F34 KP_2 keycode 121 = F35 F35 KP_3 Next keycode 122 = keycode 123 = keycode 124 = keycode 125 = Help keycode 126 = Caps_Lock keycode 127 = Meta_L keycode 128 = space keycode 129 = Mode_switch keycode 130 = Next keycode 131 = keycode 132 = KP_Add

--MGYHOYXEY6WxJCY8--



This archive was generated by hypermail 1.03b2.