nanogui: Make the mouse and keyboard optional but able to reconnect without restarting
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