PRINT (Print Screen) key event and full screen problems in windib/windx drivers

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:

windows only reports print screen on KEYUP
not KEYDOWN
not certain how to fix that, other than document it
Diablo-D3: well, the directx driver requires a different fix
as it doesn’t have a scancode for print screen
i’ve been trying to figure out what the deal was!
but atleast i’ve located the issues :slight_smile:
ah, well, both drivers were broken anyway!
neither one of them is fixable
without rewriting half the library
which i imagine, is why they aren’t fixed!
the windib driver issue can be half fixed :
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

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:

windows only reports print screen on KEYUP
not KEYDOWN
not certain how to fix that, other than document it

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?

Added: https://bugzilla.libsdl.org/show_bug.cgi?id=124

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.

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

Sure: https://bugzilla.libsdl.org/show_bug.cgi?id=125

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 )

Could you post a link to the patch? Does it provide full IME support?
Have you checked out the ToUnicode() support in the latest CVS code?
http://www.libsdl.org/cvs/SDL-1.2.zip

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment