Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, June 2007
Idle-detection


Message 1 in thread

I found threads for this, but they all seem very old (5+ years), so  
maybe something has changed.

Is there a way through Qt to detect when a user goes idle (stops  
typing, moving mouse, etc.) regardless if the Qt app has focus or  
not?  Nothing is apparent from the docs...

Thanks,
Bruno

--
 [ signature omitted ] 

Message 2 in thread

in what doc did you search events handle?

begin with this and after that, search again in the doc..... :-)
http://doc.trolltech.com/4.3/eventsandfilters.html


Bruno Trindade a écrit :

> I found threads for this, but they all seem very old (5+ years), so  
> maybe something has changed.
>
> Is there a way through Qt to detect when a user goes idle (stops  
> typing, moving mouse, etc.) regardless if the Qt app has focus or  
> not?  Nothing is apparent from the docs...
>
> Thanks,
> Bruno
>
> -- 
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ] 

Message 3 in thread

Hi Veronique, thanks for your response.

Qt events only help me when my Qt-based application has focus.  I  
need to be able to detect system-wide if the user has gone idle, even  
if the app is minimized or whatever.  I suspect I'll need platform- 
specific code for this, but I'm trying to avoid that if possible.

Cheers,
Bruno


On Jun 19, 2007, at 12:33 PM, veronique.lefrere@xxxxxx wrote:

> in what doc did you search events handle?
>
> begin with this and after that, search again in the doc..... :-)
> http://doc.trolltech.com/4.3/eventsandfilters.html
>
>
> Bruno Trindade a écrit :
>
>> I found threads for this, but they all seem very old (5+ years),  
>> so  maybe something has changed.
>>
>> Is there a way through Qt to detect when a user goes idle (stops   
>> typing, moving mouse, etc.) regardless if the Qt app has focus or   
>> not?  Nothing is apparent from the docs...
>>
>> Thanks,
>> Bruno
>>
>> -- 
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
>> with "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx  
> with "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ] 

Message 4 in thread

What platform?  For X11 you can use derive from QApplication and 
reimplement ::x11EventFilter which gets events for the whole server 
(within the QApplication of course).  I don't know what you'd do for Mac 
or Windows.

HTH,
Susan

Bruno Trindade wrote:
> Hi Veronique, thanks for your response.
>
> Qt events only help me when my Qt-based application has focus.  I need 
> to be able to detect system-wide if the user has gone idle, even if 
> the app is minimized or whatever.  I suspect I'll need 
> platform-specific code for this, but I'm trying to avoid that if 
> possible.
>
> Cheers,
> Bruno
>
>
> On Jun 19, 2007, at 12:33 PM, veronique.lefrere@xxxxxx wrote:
>
>> in what doc did you search events handle?
>>
>> begin with this and after that, search again in the doc..... :-)
>> http://doc.trolltech.com/4.3/eventsandfilters.html
>>
>>
>> Bruno Trindade a écrit :
>>
>>> I found threads for this, but they all seem very old (5+ years), so  
>>> maybe something has changed.
>>>
>>> Is there a way through Qt to detect when a user goes idle (stops  
>>> typing, moving mouse, etc.) regardless if the Qt app has focus or  
>>> not?  Nothing is apparent from the docs...
>>>
>>> Thanks,
>>> Bruno
>>>
>>> -- 
>>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx 
>>> with "unsubscribe" in the subject or the body.
>>> List archive and information: http://lists.trolltech.com/qt-interest/
>>>
>>>
>>
>> -- 
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx 
>> with "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>
> -- 
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>


---

This communication contains confidential information. If you are not the intended recipient please return this email to the sender and delete it from your records.

Diese Nachricht enthält vertrauliche Informationen. Sollten Sie nicht der beabsichtigte Empfänger dieser E-mail sein, senden Sie bitte diese an den Absender zurück und löschen Sie die E-mail aus Ihrem System.

--
 [ signature omitted ] 

Message 5 in thread

Forgot to mention that you'd use this in conjunction with a QTimer.  If 
you get events, you reset the timer.  If the timer times out, you've 
received no events.

Susan Macchia wrote:
> What platform?  For X11 you can use derive from QApplication and 
> reimplement ::x11EventFilter which gets events for the whole server 
> (within the QApplication of course).  I don't know what you'd do for 
> Mac or Windows.
>
> HTH,
> Susan
>
> Bruno Trindade wrote:
>> Hi Veronique, thanks for your response.
>>
>> Qt events only help me when my Qt-based application has focus.  I 
>> need to be able to detect system-wide if the user has gone idle, even 
>> if the app is minimized or whatever.  I suspect I'll need 
>> platform-specific code for this, but I'm trying to avoid that if 
>> possible.
>>
>> Cheers,
>> Bruno
>>
>>
>> On Jun 19, 2007, at 12:33 PM, veronique.lefrere@xxxxxx wrote:
>>
>>> in what doc did you search events handle?
>>>
>>> begin with this and after that, search again in the doc..... :-)
>>> http://doc.trolltech.com/4.3/eventsandfilters.html
>>>
>>>
>>> Bruno Trindade a écrit :
>>>
>>>> I found threads for this, but they all seem very old (5+ years), 
>>>> so  maybe something has changed.
>>>>
>>>> Is there a way through Qt to detect when a user goes idle (stops  
>>>> typing, moving mouse, etc.) regardless if the Qt app has focus or  
>>>> not?  Nothing is apparent from the docs...
>>>>
>>>> Thanks,
>>>> Bruno
>>>>
>>>> -- 
>>>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx 
>>>> with "unsubscribe" in the subject or the body.
>>>> List archive and information: http://lists.trolltech.com/qt-interest/
>>>>
>>>>
>>>
>>> -- 
>>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx 
>>> with "unsubscribe" in the subject or the body.
>>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>> -- 
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx 
>> with "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>>
>>
>


---

This communication contains confidential information. If you are not the intended recipient please return this email to the sender and delete it from your records.

Diese Nachricht enthält vertrauliche Informationen. Sollten Sie nicht der beabsichtigte Empfänger dieser E-mail sein, senden Sie bitte diese an den Absender zurück und löschen Sie die E-mail aus Ihrem System.

--
 [ signature omitted ] 

Message 6 in thread

You can do the same on Windows using the QApplication winEventFilter (and on mac there is the macEventFilter...

Though I found it interesting, that the winEvent and x11Event filters are in different plaes... winEvent is in QCoreApp and x11 and mac are in QApp

I would think it would be pretty easy to wrap it inside QApplication and #ifdef the correct code per platform, and send out a custom QEvent..

Scott

> -----Original Message-----
> From: Susan Macchia [mailto:qt-list@xxxxxxxxxxxxx]
> Sent: Tuesday, June 19, 2007 10:13 AM
> To: Bruno Trindade
> Cc: Qt-interest
> Subject: Re: Idle-detection
> 
> What platform?  For X11 you can use derive from QApplication and
> reimplement ::x11EventFilter which gets events for the whole server
> (within the QApplication of course).  I don't know what you'd do for Mac
> or Windows.
> 
> HTH,
> Susan
> 
> Bruno Trindade wrote:
> > Hi Veronique, thanks for your response.
> >
> > Qt events only help me when my Qt-based application has focus.  I need
> > to be able to detect system-wide if the user has gone idle, even if
> > the app is minimized or whatever.  I suspect I'll need
> > platform-specific code for this, but I'm trying to avoid that if
> > possible.
> >
> > Cheers,
> > Bruno
> >
> >
> > On Jun 19, 2007, at 12:33 PM, veronique.lefrere@xxxxxx wrote:
> >
> >> in what doc did you search events handle?
> >>
> >> begin with this and after that, search again in the doc..... :-)
> >> http://doc.trolltech.com/4.3/eventsandfilters.html
> >>
> >>
> >> Bruno Trindade a écrit :
> >>
> >>> I found threads for this, but they all seem very old (5+ years), so
> >>> maybe something has changed.
> >>>
> >>> Is there a way through Qt to detect when a user goes idle (stops
> >>> typing, moving mouse, etc.) regardless if the Qt app has focus or
> >>> not?  Nothing is apparent from the docs...
> >>>
> >>> Thanks,
> >>> Bruno
> >>>
> >>> --
> >>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
> >>> with "unsubscribe" in the subject or the body.
> >>> List archive and information: http://lists.trolltech.com/qt-interest/
> >>>
> >>>
> >>
> >> --
> >> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
> >> with "unsubscribe" in the subject or the body.
> >> List archive and information: http://lists.trolltech.com/qt-interest/
> >
> > --
> > To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> > "unsubscribe" in the subject or the body.
> > List archive and information: http://lists.trolltech.com/qt-interest/
> >
> >
> 
> 
> ---
> 
> This communication contains confidential information. If you are not the
> intended recipient please return this email to the sender and delete it
> from your records.
> 
> Diese Nachricht enthält vertrauliche Informationen. Sollten Sie nicht der
> beabsichtigte Empfänger dieser E-mail sein, senden Sie bitte diese an den
> Absender zurück und löschen Sie die E-mail aus Ihrem System.
> 
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ] 

Message 7 in thread

"Bruno Trindade" <bruno@xxxxxxxxx> wrote in message 
news:EE6BC074-9CB2-4F27-8162-BF5A6AFBA133@xxxxxxxxxxxx
>I found threads for this, but they all seem very old (5+ years), so 
>maybe something has changed.
>
> Is there a way through Qt to detect when a user goes idle (stops 
> typing, moving mouse, etc.) regardless if the Qt app has focus or  not? 
> Nothing is apparent from the docs...
>
> Thanks,
> Bruno

You could connect to QAbstractEventDispatcher::aboutToBlock, which 
indicates that there are no more messages in the queue. This is not only 
user messages though, there is no API in Qt that would be equivalent to 
MFC's OnIdle.

Volker


--
 [ signature omitted ]