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

Qt-interest Archive, June 2007
system wide event filtering


Message 1 in thread

Hi all,

I'm working on an app that runs on a linux PC, taking over the entire 
PC.  The user sees it as a "station".  The app is made up of many 
processes, many of which have a GUI.  There is one main app (call it the 
master) which controls the display of the others (sub-apps).  One of the 
requirements is to timeout and go back to the master if there is no 
activity in any of the sub-apps (thus closing the sub-apps).

I need system wide event filtering.  I've tried 
QApplication::x11EventFilter which works fine for one app, but doesn't 
of course, deliver events from the others.  I've been looking at 
QAbstractEventDispatcher::setEventFilter, but the event filter's 
signature is
    bool myEventFilter(void *message)

What is "message"?  I only care if the mouse has been moved/pressed or 
there are key presses.  Does anyone have any experience with this filter?

TIA,
Susan

--
 [ signature omitted ] 

Message 2 in thread

Just tried out QAbstractEventDispatcher and I didn't get mouse button & 
key presses from the sub-apps.  Do I have to go into manage my own X 
event loop ?  Any ideas?

Susan Macchia wrote:
> Hi all,
>
> I'm working on an app that runs on a linux PC, taking over the entire 
> PC.  The user sees it as a "station".  The app is made up of many 
> processes, many of which have a GUI.  There is one main app (call it 
> the master) which controls the display of the others (sub-apps).  One 
> of the requirements is to timeout and go back to the master if there 
> is no activity in any of the sub-apps (thus closing the sub-apps).
>
> I need system wide event filtering.  I've tried 
> QApplication::x11EventFilter which works fine for one app, but doesn't 
> of course, deliver events from the others.  I've been looking at 
> QAbstractEventDispatcher::setEventFilter, but the event filter's 
> signature is
>    bool myEventFilter(void *message)
>
> What is "message"?  I only care if the mouse has been moved/pressed or 
> there are key presses.  Does anyone have any experience with this filter?
>
> TIA,
> Susan
>
> -- 
> 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

Susan Macchia wrote:
> Just tried out QAbstractEventDispatcher and I didn't get mouse button &
> key presses from the sub-apps.  Do I have to go into manage my own X
> event loop ?  Any ideas?

Have a look at the code for XScreensaver; it'll probably be informative.

--
 [ signature omitted ] 

Message 4 in thread

Craig Ringer wrote:
> Susan Macchia wrote:
>> Just tried out QAbstractEventDispatcher and I didn't get mouse button &
>> key presses from the sub-apps.  Do I have to go into manage my own X
>> event loop ?  Any ideas?
> 
> Have a look at the code for XScreensaver; it'll probably be informative.

Sorry, that was a stupid thing to say, since that'll almost certainly
rely on what you seek to avoid. Whoops.

--
 [ signature omitted ] 

Message 5 in thread

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
:)<br>
<br>
Yah - I know how to do that kind of think in X, and of course the
screensaver takes over the screen and is a "window" on top of all
others.&nbsp; I'm trying to determine if there's activity in more than one
*process* - hence the difficulty.&nbsp; What I'm doing is checking for
activity in conjunction with a timer in each application/process.&nbsp; The
chances that a timeout will occur in one process (hence closing it)
while the user is interacting with another process is slim to none in
this "application", so while not perfect, it is probably good enough
(especially since our app takes over the whole desktop - the user
doesn't use the station in the typical manner with any standard
desktop, so we should be ok).<br>
<br>
Thanks anyway.&nbsp; And if anyone else has any ideas, I'd love to hear them.<br>
<br>
-- Susan<br>
<br>
Craig Ringer wrote:
<blockquote cite="mid:467AD916.8090607@xxxxxxxxxxxxxxxxxxxxx";
 type="cite">
  <pre wrap="">Craig Ringer wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Susan Macchia wrote:
    </pre>
    <blockquote type="cite">
      <pre wrap="">Just tried out QAbstractEventDispatcher and I didn't get mouse button &amp;
key presses from the sub-apps.  Do I have to go into manage my own X
event loop ?  Any ideas?
      </pre>
    </blockquote>
    <pre wrap="">Have a look at the code for XScreensaver; it'll probably be informative.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Sorry, that was a stupid thing to say, since that'll almost certainly
rely on what you seek to avoid. Whoops.

--
 [ signature omitted ] 

Message 6 in thread

If you call all subprocess you should be able to use QProcess for interprocess 
comm (inherits QIODevice, so daddy can read kids output, kids only have to 
tell daddy they're tired ;)
Otherwise you'll have to have a look for real IPC (e.g. dbus)

Thomas

Am Donnerstag, 21. Juni 2007 20:12 schrieb Susan Macchia:
> Just tried out QAbstractEventDispatcher and I didn't get mouse button &
> key presses from the sub-apps.  Do I have to go into manage my own X
> event loop ?  Any ideas?
>
> Susan Macchia wrote:
> > Hi all,
> >
> > I'm working on an app that runs on a linux PC, taking over the entire
> > PC.  The user sees it as a "station".  The app is made up of many
> > processes, many of which have a GUI.  There is one main app (call it
> > the master) which controls the display of the others (sub-apps).  One
> > of the requirements is to timeout and go back to the master if there
> > is no activity in any of the sub-apps (thus closing the sub-apps).
> >
> > I need system wide event filtering.  I've tried
> > QApplication::x11EventFilter which works fine for one app, but doesn't
> > of course, deliver events from the others.  I've been looking at
> > QAbstractEventDispatcher::setEventFilter, but the event filter's
> > signature is
> >    bool myEventFilter(void *message)
> >
> > What is "message"?  I only care if the mouse has been moved/pressed or
> > there are key presses.  Does anyone have any experience with this filter?
> >
> > TIA,
> > Susan
> >
> > --
> > 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 7 in thread

Nice analogy :)

I've thought of this as an alternative.  Both using the read/write 
methods on QProcess or IPC.  At this point, as I stated in another part 
of this thread, I'm checking for activity in conjunction with a timer in 
each application/process.  The chances that a timeout will occur in one 
process (hence closing the process) while the user is interacting with 
another process is slim to none in this "application", so while not 
perfect, it is probably good enough (especially since our app takes over 
the whole desktop - the user doesn't use the station in the typical 
manner with any standard desktop).

If this doesn't work, I could check for changes in mouse movements 
periodically (which is what our legacy app does).

Thomas Lübking wrote:
> If you call all subprocess you should be able to use QProcess for interprocess 
> comm (inherits QIODevice, so daddy can read kids output, kids only have to 
> tell daddy they're tired ;)
> Otherwise you'll have to have a look for real IPC (e.g. dbus)
>
> Thomas
>
> Am Donnerstag, 21. Juni 2007 20:12 schrieb Susan Macchia:
>   
>> Just tried out QAbstractEventDispatcher and I didn't get mouse button &
>> key presses from the sub-apps.  Do I have to go into manage my own X
>> event loop ?  Any ideas?
>>
>> Susan Macchia wrote:
>>     
>>> Hi all,
>>>
>>> I'm working on an app that runs on a linux PC, taking over the entire
>>> PC.  The user sees it as a "station".  The app is made up of many
>>> processes, many of which have a GUI.  There is one main app (call it
>>> the master) which controls the display of the others (sub-apps).  One
>>> of the requirements is to timeout and go back to the master if there
>>> is no activity in any of the sub-apps (thus closing the sub-apps).
>>>
>>> I need system wide event filtering.  I've tried
>>> QApplication::x11EventFilter which works fine for one app, but doesn't
>>> of course, deliver events from the others.  I've been looking at
>>> QAbstractEventDispatcher::setEventFilter, but the event filter's
>>> signature is
>>>    bool myEventFilter(void *message)
>>>
>>> What is "message"?  I only care if the mouse has been moved/pressed or
>>> there are key presses.  Does anyone have any experience with this filter?
>>>
>>> TIA,
>>> Susan
>>>       


---

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 ]