PRB: Devices that Implement Mouse Support Fail to Prevent Auto Suspend (297340)



The information in this article applies to:

  • Microsoft Windows CE Platform Builder 2.11
  • Microsoft Windows CE Platform Builder 2.12
  • Microsoft Windows CE Platform Builder 3.0

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\"NoIdleTimerReset"=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.

Modification Type:MinorLast Reviewed:8/18/2005
Keywords:kbnofix kbprb KB297340