Broken keyboard/text input on 1.3?

I’m trying to get keyboard/text input into a program running SDL 1.3 and
failing miserably.

I’ve tried the 1.2 way using SDL_KEYDOWN event and checking
event.key.keysym.unicode which works a treat on a 1.2 system, but it’s not
working very well on my 1.3 system. The shift-codes for (e.g.) symbols
above the numbers are just returning the numbers…

I’ve also tried the SDL_TEXTINPUT event mechanism and while this mostly
works, it’s not perfect. It won’t “see” any control keys, the Insert,
Home, etc. keys at all, and I need my program to recognise them all.

So I’m a bit stuck.

I’d use 1.2, however it seems to crash my Debian Squeeze workstation (Atom
motherboard). It works fine on my other Atom system (Acer Aspire One), but
it’s a bit small for development work. I’ve found that if I compile 1.3
and link with that, then things seem to work OK.

And it’s not just my code either - I see the same effect with “Brandy
BASIC” - I compiled that as a test - keyboard input works OK until I type
a shifted number key, then it ignores the shift, but on a 1.2 system it’s
fine.

I’m probably going to lash something up (for myself) using SDL_KEYDOWN and
checking the shift-modifiers to keep me going on my workstation (until I
replace it)

But any other suggestions?

Is this something thats known about in 1.3?

Cheers,

Gordon

I ran into a similar situation myself, and it looks like the unicode
field is depreciated (or possibly even unused).

For keyboard up/down events for control, I used the KEYUP/DOWN
events, but for actually reading typed text (text fields), I went with
the TEXTINPUT. (looks like this was meant to replace the unicode
field).On Sat, Mar 3, 2012 at 2:14 PM, Gordon Henderson <gordon+sdl at drogon.net> wrote:

I’m trying to get keyboard/text input into a program running SDL 1.3 and
failing miserably.

I’ve tried the 1.2 way using SDL_KEYDOWN event and checking
event.key.keysym.unicode which works a treat on a 1.2 system, but it’s not
working very well on my 1.3 system. The shift-codes for (e.g.) symbols above
the numbers are just returning the numbers…

I’ve also tried the SDL_TEXTINPUT event mechanism and while this mostly
works, it’s not perfect. It won’t “see” any control keys, the Insert, Home,
etc. keys at all, and I need my program to recognise them all.

So I’m a bit stuck.

I’d use 1.2, however it seems to crash my Debian Squeeze workstation (Atom
motherboard). It works fine on my other Atom system (Acer Aspire One), but
it’s a bit small for development work. I’ve found that if I compile 1.3 and
link with that, then things seem to work OK.

And it’s not just my code either - I see the same effect with “Brandy BASIC”

  • I compiled that as a test - keyboard input works OK until I type a shifted
    number key, then it ignores the shift, but on a 1.2 system it’s fine.

I’m probably going to lash something up (for myself) using SDL_KEYDOWN and
checking the shift-modifiers to keep me going on my workstation (until I
replace it)

But any other suggestions?

Is this something thats known about in 1.3?

Cheers,

Gordon


Nathan Coulson (conathan)

Location: British Columbia, Canada
Timezone: PST (-8)
Webpage: http://www.nathancoulson.com