Skip site navigation (1)Skip section navigation (2)
Date:      1 Dec 1999 00:43:07 +0100
From:      naddy@mips.rhein-neckar.de (Christian Weisgerber)
To:        freebsd-questions@freebsd.org
Subject:   Re: Accessing sysmouse(4)?
Message-ID:  <821neb$1gf2$1@bigeye.rhein-neckar.de>
References:  <821asn$17d7$1@bigeye.rhein-neckar.de> <19991130152135.B59749@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Dan Nelson <dnelson@emsphone.com> wrote:

> > Is there any real documentation or sample code to show how an
> > application at the console can access sysmouse(4)?
> 
> The sysmouse manpage seems to be sufficient.

Well, at the beginning it says a process which wants to use the
mouse should open /dev/sysmouse and read from there. I tried that
(noticing that /dev/sysmouse is 600 root:wheel), and the result
didn't look too good. In particular, I got far fewer data from the
device than I should have by comparison to the actual mouse movement.

>     mi.operation = MOUSE_GETINFO;
>     if (ioctl(fileno(stdin), CONS_MOUSECTL, &mi) < 0)
>         err(1,"CONS_MOUSECTL");
>     printf("%d %d %d\n", mi.u.data.x, mi.u.data.y, mi.u.data.buttons);

Hmm, that's also the approach taken by libvgl. The description in
the man page made me think that the ioctl() interface is aimed at
servers such as moused rather than applications.

> I can't seem to find an ioctl that'll tell me font height.

I've looked through /sys/dev/syscons/ and although the font size
is used internally all over, I can't find an interface to export
it either. I guess I'll ask Kazutaka.

-- 
Christian "naddy" Weisgerber                  naddy@mips.rhein-neckar.de



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?821neb$1gf2$1>