Hi all,
For my project I have an application where everything is linked staticly and
another where my
SDL related code is located inside a DLL. The key event appears to be
incosistent with these
two scenario’s. For the staticly linked scenario I must use key.keysym.mod
while this is 0 for
the dynamicly linked version in which case I must use key.keysym.sym to get
a propper value.
In both cases the same SDL DLL is used.
if mod is non-zero then using sym gives me garbage. I use the following
macro to fix it:
#define SDLKEYCODE( event ) ( (event).key.keysym.mod ?
(event).key.keysym.mod : (event).key.keysym.sym )
Although the problem is fixed I can’t help wonder what the hell is going on
here.
I really doubt this is desired behaviour.
System info:
O/S: Win32: XP (US version)
SDL version: 1.2.6 (binary distribution in dll form)
CPU: Mobile P4 1.6 Ghz
RAM: DDR 512 MB
GreeTz,
Dinand Vanvelzen.
For my project I have an application where everything is linked staticly and
another where my
SDL related code is located inside a DLL. The key event appears to be
incosistent with these
two scenario’s. For the staticly linked scenario I must use key.keysym.mod
while this is 0 for
the dynamicly linked version in which case I must use key.keysym.sym to get
a propper value.
So the dynamicly linked version is correct, if i understood well.
See http://sdldoc.csn.ul.ie/sdlkeysym.php
In both cases the same SDL DLL is used.
So do you mean you have an exe which is linked to a dll which in turn is
dynamicly linked to sdl?
if mod is non-zero then using sym gives me garbage.
Sounds like an alignment problem, though i don’t know why it would happen
in your code.
You should at least tell us what compiler you use, and where the code is.
(dll or exe?)
macro to fix it:
#define SDLKEYCODE( event ) ( (event).key.keysym.mod ?
(event).key.keysym.mod : (event).key.keysym.sym )
What if there’s a modifier?–
Hibernatus
You didn’t tell us which compiler. Anyway, if you use msvc 7 try
recompiling sdl, and use the new sdl.lib.–
Hibernatus