I wonder if anyone has any idea on what might be affecting stylus coordinates and cursor keys mappings in landscape modes?
I've observed that applications running in a landscape VGA device (Dell x51v) with HI_RES_AWARE, that is in full VGA resolution, get all stylus coordinates correctly - that is 0,0 is the top-left corner of the landscape screen. However, removing HI_RES_AWARE causes the QVGA emulation mode to kick-in and an application running in landscape receives stylus coordinates with the 0,0 being the portrait 0,0 - coordinate translation is needed in this case.
The same thing happens with cursor keys - they are well translated in landscape VGA but the codes on QVGA are as if the cursor was in portrait orientation. These are the real Windows keyCodes (VK_UP, VK_LEFT, etc.) not PHAL GetKeyList() key codes which might already be "rotated" (PHAL appears to "rotate" cursors in VGA, so they don't work).
Trying in the VS2005 emulators set to landscape always works as in the VGA scenario above (although PHAL never displays well).
PocketFrog is not being used, just plain PHAL set with an orientation set to match the current device orientation taken from ChangeDisplaySettingsEx. The PHAL display is always fine in any orientation, but there are stylus coordinates and cursor codes translations magically being done in VGA and not on the QVGA non-HI_RES_AWARE mode. In fact if you look into PocketFrog's code, it seems to do these QVGA translations (in DeviceToLogical()) but they appear not to be needed on VGA devices.
Just to summarize, in an Axim X51v:
- Native VGA Landscape:
Stylus 0,0 is landscape top-left, cursors key codes (VK_*) are correctly syncd with landscape orientation
- QVGA Landscape emulated by windows under a native VGA:
Stylus 0,0 is the portrait top-left, cursors key codes are syncd with portrait orientation
- Native QVGA Landscape:
? - not yet tested
The way out of this problem could be to understand when these "magic" coordinate and cursor codes translations are *not* done by windows mobile:
- Only in QVGA emulation mode? In this case - how to detect it?
- And is PocketFrog DeviceToLogical-like translation also needed in any native QVGA device?
- Could it be related to PHAL using GAPI? Is so is there a way to detect its use? I'm guessing the problem will not happen in GDI blitting? (Thierry help!)
With all WM5 devices supporting landscape and many new resolutions that WM 6 will bring, landscape will be more and more used, so this is quite a problem...
Thanks for any information,
Jorge Diogo
Ludimate - http://Ludimate.com