9front - general discussion about 9front
 help / color / mirror / Atom feed
* Re: [9front] !#&%&^#*@ RIO!!!
@ 2018-12-13 11:23 cinap_lenrek
  2018-12-13 13:28 ` Ethan Gardener
  0 siblings, 1 reply; 10+ messages in thread
From: cinap_lenrek @ 2018-12-13 11:23 UTC (permalink / raw)
  To: 9front

huh? rio doesnt use event library. it uses mouse(2) instead, which gives
you a Mousectl* that contains a channel. the "mouse" variable of
type Mouse* points into that mousectl which caches the most recent mouse
data read from the channel. it gets updated by readmouse() which is
in libdraw.

here:

int
readmouse(Mousectl *mc)
{
	if(mc->image){
		Display *d = mc->image->display;
		if(d->bufp > d->buf)
			flushimage(d, 1);
	}
	if(recv(mc->c, &mc->Mouse) < 0){
		fprint(2, "readmouse: %r\n");
		return -1;
	}
	return 0;
}

note that mouse == &mc->Mouse because:

	mousectl = initmouse(nil, screen);
	if(mousectl == nil)
		error("can't find mouse");
	mouse = mousectl;

--
cinap


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-12-21  8:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-13 11:23 [9front] !#&%&^#*@ RIO!!! cinap_lenrek
2018-12-13 13:28 ` Ethan Gardener
2018-12-18 22:47   ` Reading/understanding OS code (WAS: Re: [9front] !#&%&^#*@ RIO!!!) magma698hfsp273p9f
2018-12-18 23:41     ` Julius Schmidt
2018-12-19  7:44       ` Steve Simon
2018-12-19  8:19         ` hiro
2018-12-19  8:02       ` hiro
2018-12-20 20:20         ` Ethan Gardener
2018-12-20 20:12       ` Ethan Gardener
2018-12-21  8:22     ` Reading/understanding OS code -- documentation Ethan Gardener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).