VUIDMICE(4M) | STREAMS Modules | VUIDMICE(4M) |
vuidmice, vuidm3p, vuidm4p, vuidm5p, vuid2ps2, vuid3ps2 - converts mouse protocol to Firm Events
#include <sys/stream.h>
#include <sys/vuid_event.h>
#include <sys/vuid_wheel.h>
int ioctl(fd, I_PUSH, vuidm3p);
int ioctl(fd, I_PUSH, vuidm4p);
int ioctl(fd, I_PUSH, vuidm5p);
int ioctl(fd, I_PUSH, vuid2ps2);
int ioctl(fd, I_PUSH, vuid3ps2);
The STREAMS modules vuidm3p, vuidm4p, vuidm5p, vuid2ps2, and vuid3ps2 convert mouse protocols to Firm events. The Firm event structure is described in <sys/vuid_event.h>. Pushing a STREAMS module does not automatically enable mouse protocol conversion to Firm events. The STREAMS module state is initially set to raw or VUID_NATIVE mode which performs no message processing. You must change the state to VUID_FIRM_EVENT mode to initiate mouse protocol conversion to Firm events. This can be accomplished by the following code:
int format; format = VUID_FIRM_EVENT; ioctl(fd, VUIDSFORMAT, &format);
You can also query the state of the STREAMS module by using the VUIDGFORMAT option.
int format; int fd; /* file descriptor */ ioctl(fd, VUIDGFORMAT, &format); if ( format == VUID_NATIVE ); /* The state of the module is in raw mode. * Message processing is not enabled. */ if ( format == VUID_FIRM_EVENT ); /* Message processing is enabled. * Mouse protocol conversion to Firm events * are performed.
The remainder of this section describes the processing of STREAMS messages on the read- and write-side.
M_DATA
M_FLUSH
M_IOCTL
M_FLUSH
VUIDGFORMAT
VUIDSFORMAT
The following wheel support ioctls are defined for PS/2 mouse only:
VUIDGWHEELCOUNT
VUIDGWHEELINFO
typedef struct {
int vers;
int id;
int format;
} wheel_info;
The ioctl takes a pointer to "wheel_info" structure with the "vers" set to the current version of the "wheel_info" structure and "id" set to the id of the wheel for which the information is desired.
VUIDSWHEELSTATE
VUIDGWHEELSTATE
stateflags is an OR'ed set of flag bits. The only flag currently defined is VUID_WHEEL_STATE_ENABLED.
When stateflags is set to VUID_WHEEL_STATE_ENABLED the module converts motion of the specified wheel into VUID events and sends those up stream.
Wheel events are disabled by default.
Applications that want to change a flag should first get the current flags and then change only the bit they want.
typedef struct {
int vers;
int id;
uint32_t stateflags;
} wheel_state;
These ioctls take pointer to 'wheel_state' as an argument with the 'vers' and 'id' members filled up. These members have the same meaning as that for 'VUIDGWHEELINFO' ioctl.
Module | Protocol Type | Device |
vuidm3p | 3-Byte Protocol Microsoft 2 Button Serial Mouse | /dev/tty* |
vuidm4p | 4-Byte Protocol Logitech 3 Button Mouseman | /dev/tty* |
vuidm5p | Logitech 3 Button Bus Mouse Microsoft Bus Mouse | /dev/logi/ dev/msm |
vuid2ps2 | PS/2 Protocol 2 Button PS/2 Compatible Mouse | /dev/kdmouse |
vuid3ps2 | PS/2 Protocol 3 Button PS/2 Compatible Mouse | /dev/kdmouse |
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Architecture | x86 |
STREAMS Programming Guide
June 21, 2005 | OmniOS |