Microsoft KB Archive/297340

= PRB: Devices that Implement Mouse Support Fail to Prevent Auto Suspend =

Article ID: 297340

Article Last Modified on 2/12/2007

-

APPLIES TO


 * Microsoft Windows CE Platform Builder 2.11
 * Microsoft Windows CE Platform Builder 2.12
 * Microsoft Encarta Reference Suite 2001

-



This article was previously published under Q297340



SYMPTOMS
Auto Suspend works as expected for keyboard and touch events. However, drivers/applications, such as for external mice, that use mouse_event or keybd_event do not prevent Auto Suspend even though there is external input device activity.



CAUSE
The internal system idle timer is not reset by events that are delivered through mouse_event or keybd_event.



RESOLUTION
Call the SystemIdleTimerReset function before you call mouse_event or keybd_event in related drivers or applications for external input devices.



STATUS
This behavior is by design.



MORE INFORMATION
There are three time-outs that involve Auto Suspend. First is the time-out after a resume (or after a cold or warm boot). This is hard-coded at 60 seconds and is not changeable. The second is the battery time-out, and the third is the external power timeout. The latter two are adjusted through Control Panel. It is expected that the minimum suspend interval is 60 seconds (in other words, a Control Panel utility should not allow the user to set this value any lower than 60 seconds or unexpected problems may result).

The idle timer is reset by the function SystemIdleTimerReset, which is an OEM function that is documented in Platform Builder. (The header file is Public\Common\Oak\Inc\Pwinuser.h, which should be included in your project automatically if the WINCEOEM environment setting is specified in either your sources or your build environment).

There are three scenarios in which the operating system calls this function automatically:
 * In GWES.exe on receipt of any keyboard characters from the keyboard driver.
 * In GWES.exe on receipt of any touch event from the touch driver.
 * In the communications components that are based on timer events. These events occur with any active Ethernet adapter or connected TCP socket. This behavior is overridable via the registry key HLM\Comm\Cxport\&quot;NoIdleTimerReset&quot;=dword:1.

The initial 60-second value is required because there are various events in the system, such as the periodic calendar update event, that will wake up the system to perform some housekeeping function. It is appropriate that the device suspend only after that activity has finished. If a method is used to detect that the user initiated the wakeup through the power key or screen tap, then SystemIdleTimerReset can be called after the resume process has finished. SystemIdleTimerReset cannot be called from the xx_PowerOff or xx_PowerOn functions. If needed, SetInterruptEvent can be used to generate an interrupt event that is handled in a driver to perform the reset. For an example, see Platform\Odo\Drivers\Serial\P2io.c.

Keywords: kbnofix kbprb KB297340

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.