Re: [AD] XIM patch for Allegro 4.1.x |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Elias Pschernig a écrit :
> Attached is a patch which should fix the detection of the number keys,
> and I commented out the locale modification, since it actually doesn't
> seem to change anything.
Very nice, both problems are fixed. To clear things up, the locale problem had
nothing to do with the AGL rect() problem. It was just that if you change the
locale on the user, basic things like strtod, printf("%f") or scanf("%f")
suddenly start behaving differently... If the locale really needs to be
changed for the initialization, it should be restored afterward.
> Hm, I was primising too much. The logfile already writes the X11
> KeySyms, e.g. it writes "eacute".. but there is no way to translate
> "eacute" into é, except a really big list, like GTK or Qt contain. I'd
> say, there's no point for such a list in Allegro. And it wouldn't help
> much, since what ASCII would you return for example for F1?
For keys like F1, scancode_to_ascii is supposed to return 0. But I agree, such
a list might be too much for allegro. Too bad X doesn't provide that
information.
> I think we should provide a function:
>
> char const *get_key_name (scancode)
>
> Which would return the name of the key. In case a driver doesn't
> implement it, it would just work like exkeys, i.e.
> get_key_name(KEY_F1) returns "F1". A driver like X11 could override it
> and display the result of KeysymToString instead.
I was using scancode_to_ascii to implement my own get_key_name. Basically, I
mapped as much unambiguous keys as possible like KEY_F1 to "F1", and for the
rest I used scancode_to_ascii.
So I wouldn't complain if such a function was added to Allegro! Although the
X11 KeySyms don't look too good: (^) is "dead_circumflex", (!) is "exclam",
(") is "quotedbl"... Maybe we could provide a small table to map common ones
to decent names; bah, I'm just being too picky, the KeySym names will do just
fine :-)
> > I think, you should report on the AGL list.. I just tried it here, and
> > it crashes with a 0 pointer reference in rect() it seems - can't see
> > how that is connected to XIM though.
>
> I tried with 4.1.16, and the example programs still crash. Can you
> confirm that AGL worked for you with 4.1.16? I'll try to investigate
> this further, but I couldn't find a connection to the XIM patch so
> far.
I can confirm AGL (0.2.4) works fine with Allegro 4.1.16. Note that I fully
recompile everything that uses allegro when changing between 4.1.16 and the
CVS snapshot; otherwise I tend to get strange behaviour, like the screen
pointer turning null in the middle of the program.
I don't think the problem is related to XIM, but rather to the new locking
mechanism that you introduced in the same patch. I'll look at this deeper and
report on AGL tomorrow.
--
Julien Cugnière