ps2.7 (2010 09)
p
ps2(7) ps2(7)
ioctl() request. The arg parameter is not used.
PS2_REPORT Obtain a prompt mode mouse report.
This request polls the mouse, obtaining a three-byte report returned in the
character buffer addressed by the arg parameter. The report has the follow-
ing format:
Byte 1 A bit map of buttons, signs, and overflows
Bit 0 Left button (1=depressed)
Bit 1 Right button (1=depressed)
Bit 2 Center button (1=depressed)
Bit 3 Always 1
Bit 4 X data sign (1=negative)
Bit 5 Y data sign (1=negative)
Bit 6 X data overflow (1=overflow)
Bit 7 Y data overflow (1=overflow)
Byte 2 X-coordinate data byte
Byte 3 Y-coordinate data byte
The X and Y coordinate values are expressed in two’s complement. The scal-
ing behavior specified via the
PS2_2TO1_SCALING ioctl()
request does
not apply to reports obtained with the
PS2_REPORT ioctl() request.
PS2_2TO1_SCALING affects only reports sent in stream mode.
PS2_STREAMMODE Put mouse into stream mode.
When in stream mode, the mouse sends a three-byte report whenever the
mouse is moved, or a button is pressed or released since the last report. The
maximum report rate is set with the
PS2_SAMPLERATE ioctl()
request.
If a button is both pressed and then released within a sample interval, it
will be reported as pressed at the end of that interval.
The stream-mode reports are obtained via the
read() system call (see
read(2)). The format of the report is identical to reports returned by the
PS2_REPORT ioctl() request described above.
When in stream mode, the
PS2_DISABLE request must be sent prior to any
other ioctl() requests.
The arg parameter is not used.
PS2_STATUS Obtain mouse status.
This request polls the mouse, obtaining a three-byte report returned in the
character buffer addressed by the arg parameter.
The status report has the following format:
Byte 1 A bit map of buttons and mouse internal state
Bit 0 Right button (1=depressed)
Bit 1 Center button (1=depressed)
Bit 2 Left button (1=depressed)
Bit 3 Always 0
Bit 4 If 0, scaling 1:1; if 1, scaling 2:1
Bit 5 If 0, disabled; if 1, enabled
Bit 6 If 0, stream mode; if 1, prompt mode
Bit 7 Always 0
Byte 2 Current resolution setting
Byte 3 Current sampling rate
PS2_RESOLUTION Set mouse resolution for X and Y coordinate values by specifying the value
passed as the first byte in the character buffer addressed by arg.Four
discrete resolutions are supported:
Resolution 200 DPI 320 DPI
HP-UX 11i Version 3: September 2010 − 5 − Hewlett-Packard Company 5