This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Possibly incorrect explanation of how WaitForSomething works (and how to fix it) [RC and CGF please comment]


Chris,

I am currently trying to understand select().
I see the following in the code:
****************
peek_windows (select_record *me, int)
{
  MSG m;
  HANDLE h;
  set_handle_or_return_if_not_open (h, me);

  if (me->read_selected && me->read_ready)
    return 1;

  if (PeekMessage (&m, (HWND) h, 0, 0, PM_NOREMOVE))
    {
      me->read_ready = TRUE;
      select_printf ("window %d(%p) ready", me->fd, me->fh->get_handle ());
      return 1;
    }
***************
What is this used for?

The current problem is not to get mouse and keyboard input,
there is already code for that. The problem is to wake up
when some input happen, and not every 10 ms.

Pierre

At 10:11 PM 4/10/2001 -0400, Christopher Faylor wrote:
>On Wed, Apr 11, 2001 at 09:23:19AM +1000, Robert Collins wrote:
>>> -----Original Message-----
>>> From: Christopher Faylor [mailto:cgf@redhat.com]
>>> Sent: Wednesday, April 11, 2001 6:09 AM
>>> To: Cygx (E-mail)
>>> Subject: Re: Possibly incorrect explanation of how WaitForSomething
>>> works (and how to fix it) [RC and CGF please comment]
>>> 
>>> 
>>> On Tue, Apr 10, 2001 at 08:09:48AM +1000, Robert Collins wrote:
>>> >I thought cygwin had fd support for keyboard and mouse? If 
>>> it doesn't,
>>> >then my suggestion would be: write it.
>>> 
>>> It only supports the keyboard and the mouse in the context of 
>>> the console.
>>> I don't think that is appropriate for the X server.
>>> 
>>> cgf
>>> 
>>
>>I'm just curious here: In Unix as I understand it, the X server physical
>>screen gets a pty? for access to the keyboard, and opens /dev/mouse |
>>/dev/cua0 | ... 
>>
>>What makes those things inappropriate for cygwin support? I'd have
>>thought that a win32 message queue handler in a cygwin linked app would
>>be more trouble than cygwin handling the messages...
>
>I was saying that the current Cygwin support is only for console devices:
>
>      if (!ReadConsoleInput (h, &input_rec, 1, &nread))
>        {
>          __seterrno ();
>          syscall_printf ("ReadConsoleInput failed, %E");
>          return -1;            /* seems to be failure */
>        }
>
>This would not be appropriate for a non-console application like the
>X server.
>
>If someone wants to add generic keyboard and mouse support for a Windows
>app, then that would be appropriate.
>
>cgf
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]