[SDL] OS independent SDL_keysym.scancode
Alan Wolfe
atrix2 at cox.net
Thu Aug 19 11:02:08 PDT 2004
could you give an example of how you are using #ifdef?
Thank you!
----- Original Message -----
From: "Sebastian Biallas" <sb at biallas.net>
To: "A list for developers using the SDL library. (includes SDL-announce)"
<sdl at libsdl.org>
Sent: Thursday, August 19, 2004 10:43 AM
Subject: Re: [SDL] OS independent SDL_keysym.scancode
> Donny Viszneki wrote:
> >
> > On Aug 18, 2004, at 2:50 AM, Sebastian Biallas wrote:
> >
> >> Donny Viszneki wrote:
> >>
> >>> You could allow for keys to be customized, or use different keymaps
> >>> depending on the locale. But this problem has little or nothing to do
> >>> with the language / country / locale of the user, I am using a laptop
> >>> and plenty of keys that exist on a full keyboard are missing, or
> >>> require holding the dreaded Function key. This is generally not
> >>> suitable for games, but most tend to let me customize my controls, so
> >>> it's not a problem any longer, you should probably do what they're
> >>> doing.
> >>
> >>
> >> While customization is in general a good idea[tm], it doesn't really
> >> help me in this topic. I'd still be forced to use scancodes instead of
> >> the keysyms, since not all keys are reachable via the keysyms. E.g. on
> >> my current locale[1], both the ESC and the '[' key map to escape.
> >> While this is good for programming / writing text, I'd prefer a raw
> >> keyboard when playing games.
> >
> >
> > Please help me understand. The reason you can't use Keysyms is because
> > you have remapped your keyboard layout?
>
> For example, yes. My keyboard layout is for writing text and
> programming. It contains a lot of meta, compose etc. keys, that only
> make sense while writing text. But when playing games I consider a
> keyboard as an input device with 102+ buttons -- not more. Why configure
> the keyboard for every game when the programmer can provide sane
> defaults independent of keyboard layout?
>
> Let me elaborate a little bit more. I currently work on PearPC[1]. If I
> would use keysyms, I'd force all users that don't use the us keyboard
> layout to configure the keyboard first; all 102+ keys! And for
> configuring they had know how the keys are arranged on an us keyboard
> (well I could provide a picture). And when the switch their layout
> (there are a lot of people who switch regulary between german/us layout,
> for writing text/programming), they had to configure again.
>
> Note that this is not only a problem with PearPC: with my current
> keyboard layout it's almost impossible to use DOSBox.
>
> My current solution is that I rely on the scancodes of SDL. A little bit
> ugly, because I have to #ifdef for all platforms, but a lot better than
> the keysyms, from a users perspective (i.e. everybody can
> compile/install pearpc without have to configure anything and the
> keyboard just works; they select whatever locale the like in the guest OS)
>
> So, the nicest solution for me would be to have host indepedent
> scancodes; something the same I currently provide in pearpc via #ifdefs.
>
>
> Sebastian
>
> [1] http://pearpc.sf.net
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
More information about the SDL
mailing list