[PATCH libxkbcommon v2 1/2] makekeys: use GNU gperf to generate perfect hashtables
spitzak at gmail.com
Thu Oct 4 09:46:59 PDT 2012
David Herrmann wrote:
> Hi Bill
> On Thu, Oct 4, 2012 at 6:40 PM, Bill Spitzak <spitzak at gmail.com> wrote:
>> David Herrmann wrote:
>>>> So since makekeys is ugly and gperf is a bit excessive, maybe we should
>>>> just keep it simple, what do you think?
>>> Works all very nice here! Thanks, I am all in favor of this approach.
>>> Reviewed-by: David Herrmann <dh.herrmann at googlemail.com>
>>> No need to resend for the small fixes I suggested, though.
>>> I am working on a case-insensitive search based on this patch. I will
>>> send it when done. The approach I am using is:
>>> Use bsearch with strcasecmp() to find _one_ of the possible solutions
>>> (not necessarily the first). Then I check the entries _before_ and
>>> _after_ the one I found whether they are equal and then I use some
>>> heuristic to return the lower-case keysym (that is, KEY_a, not KEY_A).
>> Actually binary search can always find the first match (or the last one
>> depending on exactly how it is written:
> I don't need the first one. I need the one that is the lower-case keysym.
What I meant is that you only have to look forward from the found item,
not in both directions.
More information about the wayland-devel