The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
PRINT (Print Screen) key event and full screen problems in w
Manuel Bilderbeek
Guest

Hello all,

For our SDL-powered MSX emulator (openMSX), we use a key binding to the
print-screen key (SDLK_PRINT). This works fine on e.g. Linux, but not in
Windows. Here's some quotes from durnew on IRC:

<durnew> windows only reports print screen on KEYUP
<durnew> not KEYDOWN
<durnew> not certain how to fix that, other than document it
<durnew> Diablo-D3: well, the directx driver requires a different fix
<durnew> as it doesn't have a scancode for print screen
<durnew> i've been trying to figure out what the deal was!
<durnew> but atleast i've located the issues Smile
<durnew> ah, well, both drivers were broken anyway!
<durnew> neither one of them is fixable
<durnew> without rewriting half the library
<durnew> which i imagine, is why they aren't fixed!
<durnew> the windib driver issue can be half fixed :\
<durnew> Quibus: windib only reports that scancode on KEYUP and directx
only contains a SYSRQ binding, SDL would have to give both SDLK_PRINT
and SDLK_SYSREQ the same values

Is there really nothing that could be done to get this working better
(or actually: working at all) in Windows?

The only way we could hack it into the windx driver, is to replace the
binding to SYSREQ with a binding to PRINT.... But that's not a good
solution of course.
Oh, and isn't this just a bug? If so, and if it's not yet in the
bugzilla, can someone please add it?

Then the second problem. Our emulator has a way to set the output window
to 960x720 (3 times 320x240). When setting SDL to full screen, this
works fine on X11 and with the windib driver. On one of our (Windows
using) team mate's laptop, he gets a 1400x1040 resolution (with borders)
then. But, when using the windx driver, he gets an error, caused by the
fact that no surface can be created with a SDL_SetVideoMode call... A
similar thing happened on one of our other Windows team member's machine.

Normally, SDL simply does the next-larger resolution with borders, which
indeed worked for the windib driver. But it did not work for the windx
driver! So, why doesn't it work with windx, while it does work with
windib, that resolution, albeit with borders on 1400x1050?

If we modify the code and choose the nearest resolution ourselves
(1024x768), it does work on that same system.

Again: is this a bug? If so, and if it's not yet in the bugzilla, can
someone please add it?

Thank you in advance for any help!

A last remark: some of our users have problems with non-default keyboard
layouts, like Japanese (we even have an SDL patch that adds support for
loads of Japanese keys in the windx and windib driver) and we've heard
something about Finnish keyboards as well... (see e.g.:
http://www.msx.org/forumtopicl5703.html )

--
Kind regards,

Manuel Bilderbeek