Hotkeys under WinCE

I’m developing code for Windows CE that allows front-panel button events like
the record button, task button, contacts button, etc. to be captured and used
by SDL. This is already working for the most part, but there are a few
issues I’d like to ask about, and a few questions I’d like answered.

  1. What’d be the most elegant way to do this?

The events are not WM_KEYDOWN/WM_KEYUP events, but WM_HOTKEY events; I’m
currently catching them in SDL_dibevents.c and translating them to
WM_KEYDOWN/WM_KEYUP messages, which are then pushed back into the Windows
message que for the handler to use in traditional fashion… it might be
better to just give WM_HOTKEY events their own handler for that and leave out
the other handlers entirely.

Also, while the hardware keys do not correspond from device to device - the
hardware keys on an iPaq won’t correspond exactly with those on a Casio -
they all fall within the same range of hardware key numbers, 0xc1-0xcf; so
we could expect to encompass all WinCE front-panel devices within a range of
15 keys. I’ve been able to map them to the F1-F15 key range, but that seems
ugly to me… they are NOT f1-f15 after all.

On the other hand, looking in the .h files, the Windows range of virtual keys
appears unoccupied from 0xc1-0xcf; we could simply pass the key ID directly
to SDL untranslated, and insert those keys into SDL’s virtual keytable…
we’re still left with the issue of what they should be mapped to - just F1
through F15, or something else? Perhaps an entirely new keyrange?

  1. When I pass the virtual key directly from WM_HOTKEY to WM_KEYDOWN/WM_KEYUP
    untranslated, SDL generates the proper keyup/keydown events, albeit the sym
    is ‘unknown key’… when I translate it to the F1-F15 range, however, it
    generates SDL_KEYUP messages nicely but gives no SDL_KEYDOWN messages. Any
    idea why?

Nevermind, I answered my own question. ^-^;; I figured out how to do this
without having to modify SDL at all, and released the source. See
http://burningsmell.dyndns.org/SDL_hotkey/index.html

Nice code!

One small comment: the pointer’s name ‘procUnregisterFunc’ seems misspelled – or I did not get the acronym.

I guess, you consistently copied-and-pasted it, so compiler did not notice…

Pavel> …

without having to modify SDL at all, and released the source. See
http://burningsmell.dyndns.org/SDL_hotkey/index.html

Is there some kind of SDL and PocketPC howto somewhere? Obviously
you’re someone very capable of working with SDL and WinCE, could you
put a few poiners on your website if no HOWTO exists?

Part of what gets me is that I really don’t understand the difference
between the terms Pocket PC, Windows CE, Windows Mobile and so on.

The other part that gets me is that althou eMbedded Visual C++ is nice
and familiar to Visual Studio users, I’m not a Visual Studio user, so I
can’t even work out how I’d place the SDL lib into a project in a
suitable way for Pocket PC.

Is there a precompiled Pocket PC lib, or should compiling SDL be my
first priority?

Thanks for any help, whilst I’m not new to SDL or game programming, I’m
very new to Pocket PC and Microsoft coding tools.

Paul

— Tyler Montbriand wrote: > Nevermind, I
answered my own question. ^-^;; I figured out how to> do this

without having to modify SDL at all, and released the source. See
http://burningsmell.dyndns.org/SDL_hotkey/index.html


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

Is there some kind of SDL and PocketPC howto somewhere? Obviously
you’re someone very capable of working with SDL and WinCE, could you
put a few poiners on your website if no HOWTO exists?

Part of what gets me is that I really don’t understand the difference
between the terms Pocket PC, Windows CE, Windows Mobile and so on.
Windows CE is the embedded operating system that Pocket PC’s these days use…
saying that a device uses Windows CE is about as helpful as saying it uses
Windows - yeah, but Windows What? Pocket PC 2000 and Pocket PC 2002 are more
helpful terms that describe these standards for Pocket PCs, which include the
version. Yeah, MS f$@%^ it up. No suprise.

The other part that gets me is that althou eMbedded Visual C++ is nice
and familiar to Visual Studio users, I’m not a Visual Studio user, so I
can’t even work out how I’d place the SDL lib into a project in a
suitable way for Pocket PC.
If you have a .lib file available, add it to the text list in
project->settings->link->linked libraries. The library should either be in
the root directory of your project(with the .vcw files) or in the directory
of libs for the appropriate processor. Be sure you add the libraries to ALL
settings, not just ‘arm debug’ or whatever it happens to be set to.

Is there a precompiled Pocket PC lib, or should compiling SDL be my
first priority?
No precompiled lib on libsdl.org… I can give you one if you want.

Thanks for any help, whilst I’m not new to SDL or game programming, I’m
very new to Pocket PC and Microsoft coding tools.
No prob. I’ll try and give a more complete answer later.On Wednesday 24 September 2003 04:41 am, Paul Smith wrote:

Nevermind, I answered my own question. ^-^;; I figured out how to do this
without having to modify SDL at all, and released the source. See
http://burningsmell.dyndns.org/SDL_hotkey/index.html

Very cool! :slight_smile:
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Nevermind, I answered my own question. ^-^;; I figured out how to do this
without having to modify SDL at all, and released the source. See
http://burningsmell.dyndns.org/SDL_hotkey/index.html

Could you add this to the SDL demos page? This is a great example of how
to use the SDL syswm interfaces.

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Nevermind, I answered my own question. ^-^;; I figured out how to do
this without having to modify SDL at all, and released the source. See
http://burningsmell.dyndns.org/SDL_hotkey/index.html

Could you add this to the SDL demos page? This is a great example of how
to use the SDL syswm interfaces.
Done. I’ll also be emailing you EVC3.0 projects for SDL, SDL_mixer, and
SDL_image.On Wednesday 24 September 2003 08:33 am, Sam Lantinga wrote:

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

How did you compile the SDL.dll without getting errors in SDL_wingl.c?
It seems that SDL_wingl.c makes use of some members of the
SDL_PrivateGLData that are contained within an

#ifdef HAVE_OPENGL

#endif

block in SDL_wingl_c.h and so won’t compile. I’m not quite sure what
the best fix is. Does OpenGL exist on WinCE? I solved it by enclosing
the whole of the body of Init_WGL_ARB_extensions() in a #ifdef
HAVE_OPENGL block, but I have the feeling that you shouldn’t even be
touching the SDL_wingl.c files in a WinCE project.

Maybe OpenGL will exist on there one day. Maybe it already does and I
don’t know. Anyway, there it is - the provided SDL project doesn’t
compile because of it.

— Tyler Montbriand wrote: > On Wednesday 24
September 2003 08:33 am, Sam Lantinga wrote:> > > > Nevermind, I answered my own question. ^-^;; I figured out

how to do

this without having to modify SDL at all, and released the
source. See

http://burningsmell.dyndns.org/SDL_hotkey/index.html

Could you add this to the SDL demos page? This is a great example
of how
to use the SDL syswm interfaces.
Done. I’ll also be emailing you EVC3.0 projects for SDL, SDL_mixer,
and
SDL_image.

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

I just wanted to express my thanks to Tyler for helping me get going
with SDL on the Pocket PC. The two things which caught me out were the
non-compiling file that I mentioned in another post, and that I thought
I couldn’t get the testalpha program to run.

That made me learn how to use the debugger, when I realised (using the
emulator) that the testalpha program compiled and ran perfectly, but
there was no icon.bmp file for it to read from! All fixed now.

There was a couple of warnings generated in SDL_main though, in the
winCE coe there is a #define which sets the setvbuf(x) macro to
nothing, however the setvbuf macro usually has 4 parameters. I presume
changing

#define setvbuf(x)
to
#define setvbuf(x,y,z,w)

would stop the warning, but it’s not stopping anything working so it’s
not important right now. Same goes for the setbuf(x) macro defined on
the next line.

Anyway, thanks again! I can go about making my old half finished
SDL_pac demo fit inside a smaller window now (hunts for actual
dimension of Pocket PC screen…)________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk

Hehe - Anyone feel like porting some of my SDL games for Zaurus to
PocketPC? It shouldn’t take MUCH more than a few tweaks and a recompile.
:wink:

-bill!On Thu, Sep 25, 2003 at 11:34:43PM +0100, Paul Smith wrote:

Anyway, thanks again! I can go about making my old half finished
SDL_pac demo fit inside a smaller window now (hunts for actual
dimension of Pocket PC screen…)


bill at newbreedsoftware.com Got kids? Get Tux Paint!
http://newbreedsoftware.com/bill/ http://newbreedsoftware.com/tuxpaint/

How did you compile the SDL.dll without getting errors in SDL_wingl.c?
It seems that SDL_wingl.c makes use of some members of the
SDL_PrivateGLData that are contained within an

#ifdef HAVE_OPENGL

#endif

block in SDL_wingl_c.h and so won’t compile. I’m not quite sure what
the best fix is. Does OpenGL exist on WinCE?
No. WinCE doesn’t even have DirectX.
I solved it by enclosing
the whole of the body of Init_WGL_ARB_extensions() in a #ifdef
HAVE_OPENGL block, but I have the feeling that you shouldn’t even be
touching the SDL_wingl.c files in a WinCE project.
That’s how I solved it, too. That stuff really SHOULD be in a HAVE_OPENGL
block, as far as I can tell. Under Windows it doesn’t really matter, 'cause
there’s no such thing as a Windows platform these days without OpenGL, right?
But actually, there is. And it’s called Windows CE.

Maybe OpenGL will exist on there one day. Maybe it already does and I
don’t know. Anyway, there it is - the provided SDL project doesn’t
compile because of it.
It might some day, but not until they start putting 3D hardware acceleration
on board PocketPCs. In the meantime, I’d be far more interested in having
just plain DirectX for pocketPCs; the current SDL driver works through the
WinDIB driver, and is therefore hardly ideal. But it works.On Thursday 25 September 2003 03:30 pm, Paul Smith wrote: