12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

WSMOUSE (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> WSMOUSE (9)<strong>NAME</strong>wsmouse, wsmouse_input, wsmousedevprint —wscons mouse supportSYNOPSIS#include #include voidwsmouse_input(struct device ∗msdev , u_int btns , int x , int y , int z , int w ,u_int flags);intwsmousedevprint(void ∗aux , const char ∗pnp);DESCRIPTIONThe wsmouse module is a component of the wscons(9) framework to provide machine-independent mousesupport. Most of the support is provided by the wsmouse(4) device driver, which must be a child of thehardware device driver.DATA TYPESMouse drivers providing support for wscons pointer devices will make use of the following data types:struct wsmouse_accessopsAstructure used to specify the mouse access functions. All pointer devices must provide thisstructure and pass it to the wsmouse(4) child device. It has the following members:intintvoid(∗enable)(void ∗);(∗ioctl)(void ∗v, u_long cmd, void ∗data,int flag, struct lwp ∗l);(∗disable)(void ∗);The enable member defines the function to be called to enable monitoring pointer movementsand passing these events to wscons. The disable member defines the function to disablemovement events. The ioctl member defines the function to be called to perform mouse-specificioctl calls.There is a void ∗ cookie provided by the mouse driver associated with these functions, whichis passed to them when they are invoked.struct wsmousedev_attach_argsAstructure used to attach the wsmouse(4) child device. It has the following members:const struct wsmouse_accessops ∗accessops;void ∗accesscookie;FUNCTIONSwsmouse_input(msdev , btns , x , y , z , w , flags)Callback from the mouse driver tothe wsmouse interface driver. Arguments are as follows:msdev This is the struct device pointer passed from config_found() on attaching thechild wsmouse(4) to specify the mouse device.btns This specifies the current button status. Bits for pressed buttons (which will cause theWSCONS_EVENT_MOUSE_DOWN event on wsmouse(4) device) should be set, and bitsfor released buttons (which will cause the WSCONS_EVENT_MOUSE_UP event) shouldbe zero. The left most button state should be in LSB, i.e. for typical three button mouse,the left button is 0x01, the middle button is 0x02, and the right button is 0x04.<strong>NetBSD</strong> 3.0 November 12, 2006 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!