nanogui: Thread: Make the mouse and keyboard optional but able to reconnect without restarting


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Make the mouse and keyboard optional but able to reconnect without restarting
From: "Martin Kajdas" ####@####.####
Date: 25 Jun 2007 21:21:05 +0100
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC22915FB@mkmail.MKPROD.COM>

I have a situation where the mouse (mou_ser.c) and keyboard (ttyscan)
are optional but I need to be able to connect them at will and have the
app use them when connected.

Right now, I can use the app + nano-X with the mouse and keyboard.
I can also use the same app + the same nano-X without the mouse and
keyboard by returning -2 (instead of -1) from the appropriate drivers.

The problem is that when I connect the mouse/keyboard I need to restart
the app + nano-X to take advantage of it and this is not acceptable.
What I need is to have the app sense when the mouse/keyboard are
connected and use them and when they are not connected to not use them.

Before I take some wrong path, I thought I ask a question and maybe
there is some easy way of doing it.

I am thinking of having 1 sec. Timer to call some function (which one?)
to detect the presence of mouse/keyboard and calling the nano-X server
function (which one?) to enable/disable these services.

Any suggestions?

Martin
Subject: RE: [nanogui] Make the mouse and keyboard optional but able to reconnect without restarting
From: "Martin Kajdas" ####@####.####
Date: 25 Jun 2007 21:40:41 +0100
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC22915FC@mkmail.MKPROD.COM>

More info...
The problem is only with the mouse, the keyboard (either PS/2 or USB) I
can plug and unplug at any time and it works properly.


-----Original Message-----
From: Martin Kajdas ####@####.#### 
Sent: Monday, June 25, 2007 1:20 PM
To: ####@####.####
Subject: [nanogui] Make the mouse and keyboard optional but able to
reconnect without restarting

I have a situation where the mouse (mou_ser.c) and keyboard (ttyscan)
are optional but I need to be able to connect them at will and have the
app use them when connected.

Right now, I can use the app + nano-X with the mouse and keyboard.
I can also use the same app + the same nano-X without the mouse and
keyboard by returning -2 (instead of -1) from the appropriate drivers.

The problem is that when I connect the mouse/keyboard I need to restart
the app + nano-X to take advantage of it and this is not acceptable.
What I need is to have the app sense when the mouse/keyboard are
connected and use them and when they are not connected to not use them.

Before I take some wrong path, I thought I ask a question and maybe
there is some easy way of doing it.

I am thinking of having 1 sec. Timer to call some function (which one?)
to detect the presence of mouse/keyboard and calling the nano-X server
function (which one?) to enable/disable these services.

Any suggestions?

Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: ####@####.####
For additional commands, e-mail: ####@####.####

Subject: Re: [nanogui] Make the mouse and keyboard optional but able to reconnect without restarting
From: "Greg Haerr" ####@####.####
Date: 26 Jun 2007 06:06:42 +0100
Message-Id: <0e8101c7b7af$c462af30$2f01a8c0@HaydenLake>

> I am thinking of having 1 sec. Timer to call some function (which one?)
to detect the presence of mouse/keyboard and calling the nano-X server
function (which one?) to enable/disable these services.

All this should likely be handled within the mouse driver itself.
The only problem is that usually, the mouse driver returns
a file descriptor which is then used in a select, and that
file descriptor may not be valid at times.  For the case
where select() can't be used, we added a Poll entry point
in the MOUSEDEVICE struct.  When not NULL, this
entry point is called, rather than the select being used.  This
is where you would do your dirty work...

Another idea would be to rig up the mouse driver like the
pipe-based keyboard driver (see drivers/kbd_pipe.c), and
have the mouse be handled on the other side of the pipe,
handling things specially when required.  This would have
the advantage of not screwing around with file descriptors
in the nano-X server, since the pipe would always be open,
even if the mouse wasn't currently connected.

Regards,

Greg

Subject: Re: [nanogui] Make the mouse and keyboard optional but able to reconnect without restarting
From: "Martin Kajdas" ####@####.####
Date: 26 Jun 2007 20:36:24 +0100
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC22915FD@mkmail.MKPROD.COM>

I did not really get into the mouse driver yet but it appears that the
file descriptor is initialized in the open() and if the mouse is not
found, the descriptor is not initialized and therefore the mouse is
never operational.
I did not notice any polling functions that would solve my problem.
I will investigate both alternatives and report the outcome.

(FYI Ricardo)
I know that the mouse is detected by Linux every time it is plugged in
as a message stating this fact is printed in the console.
Linux can use the mouse but nano-X needs to be restarted to initialize
its descriptor to make the use of it.

Thank you,
Martin
Subject: Re: [nanogui] Make the mouse and keyboard optional but able to reconnect without restarting
From: "Martin Kajdas" ####@####.####
Date: 26 Jun 2007 21:48:20 +0100
Message-Id: <CF2BB830A62F914F848E5AD5FFF57AC22915FE@mkmail.MKPROD.COM>

I have added the Poll entry point to the MOUSEDEVICE struct but the poll
function is never called.
The open() is called and I return -2 after all default initializations.
I did not find the poll calling code anywhere.
Am I missing something?
I am using Microwidows 0.92
Martin
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.