[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [glob2-devel] plus key bug
From: |
Joe Wells |
Subject: |
Re: [glob2-devel] plus key bug |
Date: |
Thu, 05 Apr 2007 17:42:05 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Stéphane Magnenat <address@hidden> writes:
> On Thursday 05 April 2007 16:09:09 Joe Wells wrote:
>> Joe Wells <address@hidden> writes:
>> > BUG: Typing "+" (on my keyboard this is "Shift" together with "=")
>> > doesn't work. I can only use the keypad "+". This is a bigger
>> > problem for me because my particular keyboard (which is on my portable
>> > computer) doesn't actually have a keypad and simulates one by using
>> > the num-lock key to temporarily turn many ordinary keys (7, 8, 9, 0,
>> > u, i, o, p, [, j, k, l, ;, m, ",", ., and /) into keypad keys.
>>
>> I now know why this is happening. The SDL key events glob2 gets for
>> “+” are:
>>
>> SDLK_LSHIFT (key down) (this could also be SDLK_RSHIFT)
>> SDLK_EQUALS (key down)
>> SDLK_EQUALS (key up)
>> SDLK_LSHIFT (key up)
>>
>> glob2 is expecting to get just SDLK_PLUS instead, so it ignores the
>> keys.
>>
>> I am guessing the main developers must use a keyboard where “+” is not
>> a shifted key. Am I right?
>>
>> I'm not sure what the correct solution is. I suppose there is some
>> SDL function that will translate the keys being pressed into the
>> correct ASCII symbol.
>>
>> Anyway, it would be nice if “=” did the same thing as “+” so I would
>> not have to press the shift key ...
>
> Not really,
I'm not sure what you mean by “not really”. Are you saying you
dislike my idea that “=” could do the same as “+”? For my keyboard,
“=” is a much better character to use because it doesn't require using
the shift key. It would remind me of “+” because it is on the same
key.
> but those things should be handled by SDL
I think they probably are, but it needs invoking the right functions.
A quick look at the libsdl documentation installed on my computer at
file:///usr/share/doc/libsdl1.2-dev/docs/html/guideinputkeyboard.html
makes me think that the “unicode” field of the key event will hold the
right information provided the SDL_EnableUNICODE function is called at
initialization time to ask SDL to convert key events into characters.
--
Joe
> and we never had enough
> motivation to workaround this in a generic way. It would be nice to see how
> others SDL based games are handling this.
>
> I agree that for the user, it should just work.
>
> Steph
>
> --
> http://nct.ysagoon.com
- [glob2-devel] feedback on Globulation 2 (long, with many topics), Joe Wells, 2007/04/05
- Re: [glob2-devel] feedback on Globulation 2 (long, with many topics), Bradley Arsenault, 2007/04/05
- strangeness when upgrading racetracks and swimming pools (was: [glob2-devel] feedback on Globulation 2 (long, with many topics)), Joe Wells, 2007/04/05
- Re: [glob2-devel] feedback on Globulation 2 (long, with many topics), Kai Antweiler, 2007/04/05