Re: [AD] XIM patch for Allegro 4.1.x

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Elias Pschernig a écrit :
> > (2) exkeys behave strangely when it asks you to hold numbers, but the
> > KEY_0 and co. constants don't mean numbers anymore :-) I wonder if we
> > should remove/change this part ? Maybe even all the parts of the examples
> > that make assumptions about the keyboard layout ?
>
> Odd. Can you run the debug version, and send me allegro.log? Currently
> it prints out which X11 Keysym it maps to which Allegro KEY_* constant
> - so probably we can just add the keys. I'm assuming the digits are
> reported by X11 as secondary keys, so could just add a check for
> them..

Allegro.log attached. Here's what the top row of my keyboard looks like, if 
that helps:

  1   2     3     4     5     6     7     8     9     0
  &   é ~   " #   ' {   ( [   - |   è `   _ \   ç ^   à @

As expected, the 4th and 6th keys get assigned KEY_QUOTE and KEY_MINUS, and 
the others get random constants. I'm not sure there is much you can do about 
that. KEY_0 and co. are just part of the constants that only make sense on a 
QWERTY keyboard.

> > (3) pressing a dead key (like ^) seems to set key[0]. No one is supposed
> > to be looking into key[0], but I just though I'd mention it.
>
> Hm, not sure. I'll investigate. A deadkey should produce a KEY_* hit,
> but without unicode (and without adding anything in the keyboard
> buffer), and the next key then should create a KEY_* and the composed
> unicode. I may be using 0 instead of the KEY_* currently.

Sorry, I expressed myself poorly. Dead keys work exactly as you describe, but  
as a side effect, they set key[0]. Not really a problem, but I thought you 
might want to know.

> > (4) Are you going to implement scancode_to_ascii() ? This is a very
> > usefull function, for example to display meaningful key names in a
> > controls-configuration screen. Even more so now that a lot of KEY_*
> > constants have lost their meaning...
>
> I was going to add a scancode_to_ascii, which would just map e.g.
> KEY_A to A. But it should be possible to create a reverse lookup
> table, and provide the actual ascii - I'll add it.

That'd be wonderfull, thanks!

> > (5) The changes made to the X port seem to have broken AllegroGL :-( Some
> > of its examples work, but other crash. In my current project, if I call
> > install_keyboard(), there are things that fails for no apparent
> > reasons...
>
> Hm.. this sounds bad. Probably has to do with X locking. I'll try to
> investigate, but NVidia's drivers are broken for my card.

I can help if you need. Also, can't you use OpenGL unaccelerated ? That might 
be enough to test. Or maybe this is a problem for Bob to fix ;-) Should I 
report on [AGL] ?

Anyway, here's what I could gather after a bit of investigation :

The AllegroGL examples that fail are dumbtest, exgui and exalleg. They have in 
common that they use rect() and rectfill() directly, or indirectly through 
gui objects. After commenting these use, they work fine. Does that help ?

Also, in my program the problem was a locale problem: it seems the new 
install_keyboard somehow changes part or all of the program's locale to that 
of the keyboard layout. This is a problem with Lua, because it is known not 
to work in a locale where the decimal point is not a dot. If I put a 
setlocale(LC_ALL, "C") after install_keyboard, my program works again. Yay! 
(I don't use any allegro functions like rect).

-- 
Julien Cugnière
xkeyboard: 248 keys, 6 symbols per key.
key 8: (null) not assigned.
key 9: Escape assigned to 59.
key 10: ampersand defering.
key 11: eacute defering.
key 12: quotedbl defering.
key 13: apostrophe assigned to 69.
key 14: parenleft defering.
key 15: minus assigned to 61.
key 16: egrave defering.
key 17: underscore defering.
key 18: ccedilla defering.
key 19: agrave defering.
key 20: parenright defering.
key 21: equal assigned to 62.
key 22: BackSpace assigned to 63.
key 23: Tab assigned to 64.
key 24: a assigned to 1.
key 25: z assigned to 26.
key 26: e assigned to 5.
key 27: r assigned to 18.
key 28: t assigned to 20.
key 29: y assigned to 25.
key 30: u assigned to 21.
key 31: i assigned to 9.
key 32: o assigned to 15.
key 33: p assigned to 16.
key 34: dead_circumflex defering.
key 35: dollar defering.
key 36: Return assigned to 67.
key 37: Control_L assigned to 109.
key 38: q assigned to 17.
key 39: s assigned to 19.
key 40: d assigned to 4.
key 41: f assigned to 6.
key 42: g assigned to 7.
key 43: h assigned to 8.
key 44: j assigned to 10.
key 45: k assigned to 11.
key 46: l assigned to 12.
key 47: m assigned to 13.
key 48: ugrave defering.
key 49: twosuperior defering.
key 50: Shift_L assigned to 107.
key 51: asterisk defering.
key 52: w assigned to 23.
key 53: x assigned to 24.
key 54: c assigned to 3.
key 55: v assigned to 22.
key 56: b assigned to 2.
key 57: n assigned to 14.
key 58: comma assigned to 72.
key 59: semicolon assigned to 68.
key 60: colon defering.
key 61: exclam defering.
key 62: Shift_R assigned to 108.
key 63: KP_Multiply assigned to 87.
key 64: Alt_L assigned to 111.
key 65: space assigned to 75.
key 66: Caps_Lock assigned to 118.
key 67: F1 assigned to 47.
key 68: F2 assigned to 48.
key 69: F3 assigned to 49.
key 70: F4 assigned to 50.
key 71: F5 assigned to 51.
key 72: F6 assigned to 52.
key 73: F7 assigned to 53.
key 74: F8 assigned to 54.
key 75: F9 assigned to 55.
key 76: F10 assigned to 56.
key 77: Num_Lock assigned to 117.
key 78: Scroll_Lock assigned to 116.
key 79: KP_Home assigned to 44.
key 80: KP_Up assigned to 45.
key 81: KP_Prior assigned to 46.
key 82: KP_Subtract assigned to 88.
key 83: KP_Left assigned to 41.
key 84: KP_Begin assigned to 42.
key 85: KP_Right assigned to 43.
key 86: KP_Add assigned to 89.
key 87: KP_End assigned to 38.
key 88: KP_Down assigned to 39.
key 89: KP_Next assigned to 40.
key 90: KP_Insert assigned to 37.
key 91: KP_Delete assigned to 90.
key 92: (null) not assigned.
key 93: Mode_switch defering.
key 94: less assigned to 71.
key 95: F11 assigned to 57.
key 96: F12 assigned to 58.
key 97: Home assigned to 78.
key 98: Up assigned to 84.
key 99: Prior assigned to 80.
key 100: Left assigned to 82.
key 101: (null) not assigned.
key 102: Right assigned to 83.
key 103: End assigned to 79.
key 104: Down assigned to 85.
key 105: Next assigned to 81.
key 106: Insert assigned to 76.
key 107: Delete assigned to 77.
key 108: KP_Enter assigned to 91.
key 109: Control_R assigned to 110.
key 110: Pause assigned to 93.
key 111: Print assigned to 92.
key 112: KP_Divide assigned to 86.
key 113: ISO_Level3_Shift assigned to 112.
key 114: (null) not assigned.
key 115: Super_L assigned to 113.
key 116: Super_R assigned to 114.
key 117: Menu assigned to 115.
key 118: (null) not assigned.
key 119: (null) not assigned.
key 120: (null) not assigned.
key 121: (null) not assigned.
key 122: (null) not assigned.
key 123: (null) not assigned.
key 124: ISO_Level3_Shift *double* assigned to 112.
key 125: (null) not assigned.
key 126: KP_Equal assigned to 103.
key 127: (null) not assigned.
key 128: (null) not assigned.
key 129: (null) not assigned.
key 130: (null) not assigned.
key 131: (null) not assigned.
key 132: (null) not assigned.
key 133: (null) not assigned.
key 134: (null) not assigned.
key 135: (null) not assigned.
key 136: (null) not assigned.
key 137: (null) not assigned.
key 138: (null) not assigned.
key 139: (null) not assigned.
key 140: (null) not assigned.
key 141: (null) not assigned.
key 142: (null) not assigned.
key 143: (null) not assigned.
key 144: (null) not assigned.
key 145: (null) not assigned.
key 146: (null) not assigned.
key 147: (null) not assigned.
key 148: (null) not assigned.
key 149: (null) not assigned.
key 150: (null) not assigned.
key 151: (null) not assigned.
key 152: (null) not assigned.
key 153: (null) not assigned.
key 154: (null) not assigned.
key 155: (null) not assigned.
key 156: (null) not assigned.
key 157: (null) not assigned.
key 158: (null) not assigned.
key 159: (null) not assigned.
key 160: (null) not assigned.
key 161: (null) not assigned.
key 162: (null) not assigned.
key 163: (null) not assigned.
key 164: (null) not assigned.
key 165: (null) not assigned.
key 166: (null) not assigned.
key 167: (null) not assigned.
key 168: (null) not assigned.
key 169: (null) not assigned.
key 170: (null) not assigned.
key 171: (null) not assigned.
key 172: (null) not assigned.
key 173: (null) not assigned.
key 174: (null) not assigned.
key 175: (null) not assigned.
key 176: (null) not assigned.
key 177: (null) not assigned.
key 178: (null) not assigned.
key 179: (null) not assigned.
key 180: (null) not assigned.
key 181: (null) not assigned.
key 182: (null) not assigned.
key 183: (null) not assigned.
key 184: (null) not assigned.
key 185: (null) not assigned.
key 186: (null) not assigned.
key 187: (null) not assigned.
key 188: (null) not assigned.
key 189: (null) not assigned.
key 190: (null) not assigned.
key 191: (null) not assigned.
key 192: (null) not assigned.
key 193: (null) not assigned.
key 194: (null) not assigned.
key 195: (null) not assigned.
key 196: (null) not assigned.
key 197: (null) not assigned.
key 198: (null) not assigned.
key 199: (null) not assigned.
key 200: (null) not assigned.
key 201: (null) not assigned.
key 202: (null) not assigned.
key 203: (null) not assigned.
key 204: (null) not assigned.
key 205: (null) not assigned.
key 206: (null) not assigned.
key 207: (null) not assigned.
key 208: (null) not assigned.
key 209: (null) not assigned.
key 210: (null) not assigned.
key 211: (null) not assigned.
key 212: (null) not assigned.
key 213: (null) not assigned.
key 214: (null) not assigned.
key 215: (null) not assigned.
key 216: (null) not assigned.
key 217: (null) not assigned.
key 218: (null) not assigned.
key 219: (null) not assigned.
key 220: (null) not assigned.
key 221: (null) not assigned.
key 222: (null) not assigned.
key 223: (null) not assigned.
key 224: (null) not assigned.
key 225: (null) not assigned.
key 226: (null) not assigned.
key 227: (null) not assigned.
key 228: (null) not assigned.
key 229: (null) not assigned.
key 230: (null) not assigned.
key 231: (null) not assigned.
key 232: (null) not assigned.
key 233: (null) not assigned.
key 234: (null) not assigned.
key 235: (null) not assigned.
key 236: (null) not assigned.
key 237: (null) not assigned.
key 238: (null) not assigned.
key 239: (null) not assigned.
key 240: (null) not assigned.
key 241: (null) not assigned.
key 242: (null) not assigned.
key 243: (null) not assigned.
key 244: (null) not assigned.
key 245: (null) not assigned.
key 246: (null) not assigned.
key 247: (null) not assigned.
key 248: (null) not assigned.
key 249: (null) not assigned.
key 250: (null) not assigned.
key 251: (null) not assigned.
key 252: (null) not assigned.
key 253: (null) not assigned.
key 254: (null) not assigned.
key 255: (null) not assigned.
Key 10 missing: ampersand 1 onesuperior exclamdown onesuperior exclamdown - assigned to 27.
Key 11 missing: eacute 2 asciitilde oneeighth asciitilde oneeighth - assigned to 28.
Key 12 missing: quotedbl 3 numbersign sterling numbersign sterling - assigned to 29.
Key 14 missing: parenleft 5 bracketleft threeeighths bracketleft threeeighths - assigned to 30.
Key 16 missing: egrave 7 grave seveneighths grave seveneighths - assigned to 31.
Key 17 missing: underscore 8 backslash trademark backslash trademark - assigned to 32.
Key 18 missing: ccedilla 9 asciicircum plusminus asciicircum plusminus - assigned to 33.
Key 19 missing: agrave 0 at degree at degree - assigned to 34.
Key 20 missing: parenright degree bracketright questiondown bracketright questiondown - assigned to 35.
Key 34 missing: dead_circumflex dead_diaeresis dead_diaeresis dead_abovering dead_diaeresis dead_abovering - assigned to 36.
Key 35 missing: dollar sterling currency dead_macron currency dead_macron - assigned to 60.
Key 48 missing: ugrave percent dead_circumflex dead_caron dead_circumflex dead_caron - assigned to 65.
Key 49 missing: twosuperior asciitilde notsign notsign notsign notsign - assigned to 66.
Key 51 missing: asterisk mu dead_grave dead_breve dead_grave dead_breve - assigned to 70.
Key 60 missing: colon slash periodcentered division periodcentered division - assigned to 73.
Key 61 missing: exclam section dead_belowdot dead_abovedot dead_belowdot dead_abovedot - assigned to 74.
Key 93 missing: Mode_switch (null) (null) (null) (null) (null) - assigned to 94.
Modifier 1: Shift_L Shift_R (null) (null)
Modifier 2: Caps_Lock (null) (null) (null)
Modifier 3: Control_L Control_R (null) (null)
Modifier 4: Alt_L (null) (null) (null)
Modifier 5: Num_Lock (null) (null) (null)
Modifier 6: (null) (null) (null) (null)
Modifier 7: Super_L Super_R (null) (null)
Modifier 8: Mode_switch ISO_Level3_Shift (null) (null)
Using generic color conversion blitter (8, 32).


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/