SS.Mouse Get Status

From NitrOS-9
Jump to: navigation, search

Gets mouse status.

Entry Conditions
A path number
B SS.Mouse ($89)
X data storage area address
Y mouse port select:
  0 = automatic selection
  1 = right side
  2 = left side
Exit Conditions
X data storage area address
Error Output
CC carry set on error
B error code (if invalid selection)

Additional Information

  • SS.Mouse returns information on the current mouse and its fire button. The following list defines the 32-byte data packet that SS.Mouse creates:
Pt.Valid rmb 1 Is returned info valid? (0 = no, 1 = yes)
Pt.Actv rmb 1 Active side (0 = off, 1 = right, 2 = left)
Pt.ToTm rmb 1 Timeout initial value
Pt.TTTo rmb 1 Time until timeout
  rmb 2 Reserved
Pt.TSSt rmb 2 Time since counter start
Pt.CBSA rmb 1 Current button state (Button A)
Pt.CBSB rmb 1 Current button state (Button B)
Pt.CCtA rmb 1 Click count (Button A)
Pt.CCtB rmb 1 Click count (Button B)
Pt.TTSA rmb 1 Time this state counter (Button A)
Pt.TTSB rmb 1 Time this state counter (Button B)
Pt.TLSA rmb 1 Time last state counter (Button A)
Pt.TLSB rmb 1 Time last state counter (Button B)
  rmb 2 Reserved
Pt.BDX rmb 2 Button down frozen actual X
Pt.BDY rmb 2 Button down frozen actual Y
Pt.Stat rmb 1 Window pointer type location
Pt.Res rmb 1 Resolution (0-640 by 0=10/1=1)
Pt.AcX rmb 2 Actual X value
Pt.AcY rmb 2 Actual Y value
Pt.WRX rmb 2 Window relative X
Pt.WRY rmb 2 Window relative Y
Pt.Siz equ . Packet size 32 bytes
SPt.SRX rmb 2 System use, screen relative X
SPt.SRY rmb 2 System use, screen relative Y
SPt.Siz equ . Size of packet for system use
  • Button Information:
Pt.Valid The valid byte gives the caller an indication of whether the information contained in the returned packet is accurate. The information returned by this call is only valid if the process is running on the current interactive window. If the process is on a non-interactive window, the byte is zero and the process can ignore the information returned.
Pt.Actv This byte shows which port is selected for use by all mouse functions. The default value is Right (1). You can change this value with the SS.GIP SetStat call.
Pt.ToTm This is the initial value used by Pt.TTTo.
Pt.TTTo This is the count down value (as of the instant the GetStat call is made). This value starts at the value contained in the Pt.ToTm and counts down to zero at a rate of 60 counts per second. The system maintains all counters until this value reaches 0, at which point it sets all counters and states to 0. The mouse scan routine changes int a quiet mode which requires less overhead than when the mouse is active. The timeout begins when both buttons are in the up (open) state. The timer is reinitialized to the value in Pt.ToTm when either button goes down (closed).
Pt.TSSt This counter is constantly increasing, beginning when either button is pressed while the mouse is in the quiet state. All counts are a number of ticks (60 per second). The timer counts to $FFFF, then stays at that value if additional ticks occur.
Pt.CBSA and Pt.CBSB These flag bytes indicate the state of the button at the last system clock tick. A value of 0 indicates that the button is up (open). A value other than zero indicates that the button is down (closed). Button A is available on all Tandy joysticks and mice. Button B is only available for products that have two buttons.
The system scans the mouse buttons each time it scans the keyboard.
Pt.CCtA and Pt.CCtB This is the number of clicks that have occurred since the mouse went into an active state. A click is defined as pressing (closing) the button, then releasing (opening) the button. The system counts the clicks as the button is released.
Pt.TTSA and Pt.TTSB This counter is the number of ticks that have occurred during the current state, as defined by Pt.CBSx. This counter starts at one (counts the tick when the state changes) and increases by one for each tick that occurs while the button remains in the same state (open or closed).
Pt.TLSA and Pt.TLSB This counter is the number of ticks that have occurred during the time that a button is in a state opposite of the current state. Using this count and the TTSA/TTSB count, you can determine how a button was in the previous state, even if the system returns the packet after the state has changed. Use these counters, along with the state and click count values, to define any type of click, drag, or hold convention you want.
Reserved Two packet bytes are reserved for future expansion of the returned data.
  • Position Information:
Pt.BDX and Pt.BDY These values are copies of the Pt.AcX and Pt.AcY values when either of the buttons change from an open state to a closed state.
Pt.Stat This byte contains information about the area of the screen on which the mouse is positioned. Pt.Valid must be a value other than 0 for this information to be accurate. If Pt.Valid is 0, this value is also 0 and not accurate. Three types of areas are currently defined:
0 = content region or current working area of the window
1 = control region (for use by Multi-View)
2 = off window, or on an area of the screen that is not part of the window
Pt.Res This value is the current resolution for the mouse. The mouse must always return coordinates in the range of 0-639 for the X axis and 0-191 for the Y axis. If the system is so configured, you can use the high-resolution mouse adapter which provides a 1 to 1 ratio with these values plus 1. If the adapter is not in use, the resolution is a ration of 1 to 10 on the X axis and 1 to 3 on the Y axis. The keyboard mouse provides a resolution of 1 to 1. The values in Pt.Res are:
0 = low res (x:10, y:3)
1 = high res (x,y:1)
Pt.AcX and Pt.AcY The values read from the mouse returned in the resolution as described under Pt.Res.
Pt.WRX and Pt.WRY The values read from the mouse minus the starting coordinates of the current window's working area. These values return the coordinates in numbers relative to the type of screen. For example, the X axis is in the range 0-639 for high-resolution screens and 0-319 for low-resolution screens. You can divide the window relative values by 8 to obtain absolute character positions. These values are most helpful when working in non-scaled modes.
  • The support modules for this call are CC3IO, GrfInt, and WindInt.