PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

No Game Application.

Hello,
I do have a question about PocketFrog. Let me explain what I try to do.
I have an Casio E-200 with Jacket. This Jacket supports a USB mouse. There is a generic driver built in. The USB mouse is working so far, but the big problem is, there is no mouse pointer.
The next problem with PPC, there is no support for
mouse pointers except the hour glass, which can't be moved or binded to the mouse.
So I try to implement an app/dll which have nothing else to do than showing the mouse pointer on the screen.
Is it possible to do such thing with PocketFrog? Or does anybody have an idea how to do it?

regards,
Deje
Just capture the MouseMove window message and draw a bitmapped cursor on each frame update.

Look at the GapiDraw class CGapiCursor for an example of how to implement this (www.gapidraw.com -> documentation). CGapiCursor supports both alpha maps, cursor animations and hotspots. For an example for how to use such a class you can look at the source code for the GapiDraw "simple" demo application. You should be able to code a similar class in PocketFrog in less than an hour.

/Johan
Thanks for the answer.
But I think you missunderstood me. Capturing Mouse movements is not the problem INSIDE an application or when the app is active.
But I need to capture the movements (and print the pointer on the screen) even if just the today screen is active. I need the mouse pointer to control the whole PPC, not just one app only.
Ken_McCaw · 28 Aug 2002, 01:58 UTC — USB Mouse Driver
Hi, Deje.

The video driver for the device must have support for a hardware cursor, or at least an 'emulated' software cursor. There are routines in the driver such as MovePointer which are called to manipulate the cursor position.

Since the Pocket PC relies on the stylus for input, the routines to display and move a cursor are not needed. They are usually "stubbed" - meaning there is just an entry point followed by a return statement. This saves valuable ROM space in the final OS image.

The USB Mouse driver tracks the movement, informs the GWES about the motion so that WM_MOUSEMOVE messages get generated, and also calls the MovePointer function in the video driver. As you have discovered, calling the stubbed function in the video driver does not do much. :(

So the bad news is that you will most likely have to write a video driver to get the support you are looking for. If you want to write your own shell, you could use one of the graphic libs to handle the cursor display; but there goes the "Today" screen!

HTH,
Ken McCaw

My two cents - tax = no sense
Thanks, that's what I see on the PPC.
I implemented a tray app and a dll. The tray app is to start tracking the mouse. The dll implements a timer based tracking and displays the corsur bei BitBlt it to the display. On the emulator it works great. But on the real machine, the call to GetCursorPos returns nothing.
So the question is, is it possible to hook the USB mouse driver or video driver calls to get the pointer movements?
Ken_McCaw · 29 Aug 2002, 23:56 UTC — Filtering a driver
"Hooking" the mouse messages is not 'officially' supported on the Pocket PC. The SetWindowsHookEx function does exist, however, and is located in coredll.dll. Some folks report having limited success calling it dynamically ( via LoadLibrary & GetProcAddress ) - refer to http://www.cegadgets.com/wincedevfaq.htm#10.9%20SetWindowsHookEx%20really%20does%20work,%20sort%20of for details. You may also want to post to microsoft.public.pocketpc.developer to see if anybody there has done it.
FYI

I got it managed. I use the IOCTL interface from the HID driver to get the mouse moves. Works so far. But because I bitblt the cursor into the screen, sometimes artefacs are left on the screen. However, I can now operate the Casio with the USB mouse. :)
jeremieweldin · 03 Sep 2002, 21:53 UTC — awesome, are you going to post the code or the binaries?
Are you going to post the code or the binaries?
Just wondering... :)
Sure I can post at least the binaries.

download mouse tray app

Download the zip, unzip it to any folder on your PPC and start it with the USB mouse connected. Test were done on a E200G with a Sony VAIO USB mouse. It works on both the PCCard jacket USB port as well as on the cradle USB port.
The german text just tells you to tap on the screen once (with stylus) or move the mouse for calibrating the mouse position. With OK you min the app to the tray and you can operate your PPC with the mouse. "Beenden" means cancel or stop the app.