Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange behavior in user idle detection in Adobe Air on Mac
    primarykey
    data
    text
    <p>I've got an Adobe AIR application written in pure AS3 that has some functionality that happens when the user is idle and then returns to the normal state when the user returns. I'm detecting this activity with the following code:</p> <pre><code>NativeApplication.nativeApplication.idleThreshold = 180; NativeApplication.nativeApplication.addEventListener(Event.USER_IDLE, onUserIdle); NativeApplication.nativeApplication.addEventListener(Event.USER_PRESENT, onUserPresent); </code></pre> <p>The <code>onUserIdle</code> method is called after 3 minutes as it should be, but then the <code>onUserPresent</code> event is fired almost immediately afterwards. I'm talking milliseconds later. This happens without any user input whatsoever. The bizarre thing is that this does not occur on Windows - only on OSX. And it happens on all flavors of OSX going back to 10.6.3.</p> <p>Adobe's documentation is incredibly vague on how those events are determined, so I'm not sure if there is something I can do at the system level to fix the problem. Does anyone have any experience with this issue, and if not, any other suggestions on how I can detect user idleness even when the app does not have focus?</p> <p>Just to preempt the suggestion, I cannot use mouse/keyboard listeners to simulate the same behavior because they do not work if the application loses focus, whereas the <code>NativeApplication</code> events still fire. I've also used <code>NativeProcess</code> to get the output of ioreg to get the hardware idle time as reported by the system, but it does not appear to be affected by the mouse. </p> <p>I really appreciate any assistance.</p> <p><strong>Edit: I just discovered that this does not occur when the application is run in an Administrator account on OSX. It only happens in a User account, which only serves to confuse me more.</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload