Hi Marco!

Yes I mean a client side approach.

So maybe I have to attach a keydown and a mousemove event to the client 
document which stores the last "event fired" time in a global variable.

something like:

var inactivityTimer = 
qx.ui.core.ClientDocument.getInstance()._inactivityTimer = new 
qx.client.Timer(60000);
inactivityTimer .addEventListener(qx.constant.Event.INTERVAL, function(e) {
   var now = new Date();
   if((now.getTime() - this._lastActivityTime.getTime()) > 60000) {
      alert('Locked out due to inactivity');
   }
   this.restart();
});

qx.ui.core.ClientDocument.getInstance().addEventListener("keypress", 
function(e) {
    this._inactivityTimer.restart();
    this._lastActivityTime = new Date();
});

qx.ui.core.ClientDocument.getInstance().addEventListener("mousemove", 
function(e) {
    this._inactivityTimer.restart();
    this._lastActivityTime = new Date();
});

But is it guaranteed that the event listeners get fired on every 
mousemove and keypress?


Marco Emiliozzi schrieb:
> Hello there,
>
> Perhaps you asked for a client-side approach to the problem? It could be
> done with a timer restarted every time something occurs: it's up to you to
> choose what activity means (mousemove event on the root widget for example).
> When the timer runs out pop open a modal window asking for a password or
> something similar to unlock the application.
>
> I hope it will be useful.
>
> -----Messaggio originale-----
> Hello List,
>
> has anybody implented a "lock on user inactivity"?
>
> I want to lock the application after the user did not do any actions for 
> a given time period.
>
> Any hints on how this would be implemented are highly welcome.
>
> Thanks allot.
>
> Best regards...
>
>   

-- 
Mit freundlichen Grüßen
Dietrich Streifert
Visionet GmbH


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to