QTIPS - Use of Mouse
Advanced Revelation Assembler Interface Module - Yves Pattyn, Technical Manager, Distribase, France
Version 3 Technical Highlights - Input.Char
QTIPS - Moving Objects the EASY way.
Reader's Forum - Mark Hirst Revelation C Interface - Part 1
Reader's Forum The C Interface Part 2 - Mark Hirst (Senior Techie - ICS) Reader's Clinic
Reader's Clinic - Incorrect Indexes
Vroom
RTP Series - RTP20
RTP Series - RTP12
Form.List.S
VERBatim - V5
@ATTACK - @Last.Select.Process
@ATTACK - @Save.Select
QTIPS - File Variable of File In SELECT Statement
QUERY.SUB
REVMEDIA Revisited
QTIPS - Extended Select Syntax
Spindex - A Review
Spindex vs BondTRV
REVMEDIA Revisited
QTIPS - Replacing GAS.BAR routine during PERFORM "SELECT"
QTIPS - Extended Select BY
QTIPS - EasyWriter
QTIPS - MFS - Select.Index
Reader's Clinic - Naming Routines
SecureUser
Advanced Revelation Initialisation Sequence (Overview) by Mike Pope
QTIPS - What's DAT?
Reader's Clinic
QTIPS - Use of Mouse
SecureUser
VERBatim - V25
@ATTACK - @Files.System
Advanced Revelation Initialisation Sequence (Overview) by Mike Pope
REVMEDIA Revisted
QTIPS - Use of Mouse
RTP Series - RTP27
QTIPS - Printing Large Variables from the Debugger
VERBatim - V87
VERBatim - V119
VERBatim - V125
VERBatim - V118
Advanced Revelation Assembler Interface Module - Yves Pattyn, Technical Manager, Distribase, France
QTIPS - Use of Mouse
Version 3 Technical Highlights - Mouse_Subs
Version 3 Technical Highlights - INRECT
RTP Series - RTP42
VERBatim - V65
Argument passing - Subroutines and Functions - Mike Pope
Redefining Keys
Background Processing
Reader's Clinic - Prompting for Passwords
Capture
Creating Your Own Background Processes
@ATTACK - @Edit.Keys
@ATTACK - @Index.Time
@ATTACK - @PlayBack
@ATTACK - @Priority.Int
How Indexes Are Updated
A RevTechie Replies - And Miscellaneous Jottings - Mike Pope - Revelation Technologies (UK) Ltd
QTIPS - Use of Mouse
QTIPS - Interrupt Proof Error Messages
Uncommon Knowledge - WC_Soft_Keys%
A RevTI Techie Replies - Mike Pope - Revelation Technologies (UK) Ltd
Version 3 Technical Highlights - Input.Char
Version 3 Technical Highlights - @Prog.Char
Version 3 Technical Highlights - Highlight
Redefining Keys
Background Processing
Capture
Creating Your Own Background Processes
@ATTACK - @Edit.Keys
@ATTACK - @Index.Time
@ATTACK - @PlayBack
@ATTACK - @Priority.Int
@ATTACK - @Prog.Char
How Indexes Are Updated
A RevTechie Replies - And Miscellaneous Jottings - Mike Pope - Revelation Technologies (UK) Ltd
QTIPS - Use of Mouse
QTIPS - Interrupt Proof Error Messages
Uncommon Knowledge - WC_Soft_Keys%
Version 3 Technical Highlights - Input.Char
Version 3 Technical Highlights - @Prog.Char
Version 3 Technical Highlights - Add_Buttons
Version 3 Technical Highlights - Highlight
QTIPS - Menus Without an Action Bar
Reader's Clinic - Capture Command and Captured Keystrokes
@ATTACK - @Macro.Hex
Capture Playback and Convert.Keystrokes
Reader's Clinic - Functions and Subroutines
Reader's Letters - Jim Owen
Playing with Scan Codes
Argument passing - Subroutines and Functions - Mike Pope
Catalyst
Creating Your Own Background Processes
@ATTACK - @Data
Advanced Revelation Initialisation Sequence (Overview) by Mike Pope
QTIPS - @Playback Vs @Data
QTIPS - Use of Mouse
Uncommon Knowledge - WC_WST_CHAR%
Reader's Clinic - Screen Width
VERBatim - V41
Window or Not ?
Vroom - Window Processing
QTIPS - Window Symbol Tables
VROOM - Window Processing II
@ATTACK - @HW
Uncommon Knowledge - WC_Reset%
Reader's Clinic - Related Windows
Window or Not?
Reader's Clinic - Scribe Replace Processes in Window
Soft Windows
QTIPS - Window Bug and Debugging Window Bug
Overlapping Windows And Window Menus
QTIPS - New Catalyst Option
QTIPS - Collectors on the fly
QTIPS - Blank Menus in Windows
QTIPS - Moving Objects the EASY way.
VERBatim - V70
VERBatim - V124
Menus and Menu Drivers
QTIPS - Postscript Driver Problem
Reader's Clinic - Functions and Subroutines
Argument passing - Subroutines and Functions - Mike Pope
@ATTACK - @Modal
Playing with Scan Codes
QTIPS - Compiling Protection Code
QTIPS - Invalid Code and Command
QTIPS - Code/Command Help
Compiling 64K on a Shoestring by Blaise Wrenn (LexStat Systems Ltd)
Reader's Clinic - Fixing %Windows% Using Depend.Update
QTIPS - Updating Indexes
How Indexes Are Updated
REVMEDIA Revisted

RevMedia FKB

DocumentV3I7A9
TitleQTIPS - Use of Mouse
KeywordsMOUSE
MOUSE_SUBS
MOUSE_INIT
MOUSE_DEFINITION_SUB
RBASIC
MOUSE_TEST
%%MOUSEVARS%%
INPUT.CHAR
@DATA
TextJim Owen asks "What COMMANDS can I use to access the mouse interface in an
R/Basic program?" The answer is that there are several routines available
for manipulating the mouse a SELECT VERBS "[MOUSE]" reveals these to be
MOUSE_TEST (used to check for mouse input) MOUSE_INIT (used to initialise
the mouse system information) MOUSE_DEFINITION_SUB (commuter program for
Mouse windows) and the assembler routine MOUSE_SUBS These routines
manipulate a system LABELLED common area %%MOUSEVARS%%

Mouse_Test
This is the equivalent of INPUT CHAR for mouse actions It is used to check
whether a mouse motion has been made or if a mouse key/key combination has
been pressed If such an action has been taken then the keystrokes will be
returned FROM the function and if applicable in @DATA Thus if the mouse
motion was down and left the left key press would be returned in @DATA and
the down keypress as the result of the function The order of return appears
to be that Button Presses take precedence over Y movements which in turn
take precedence over X movements Those actions WITH precedence will be
returned FROM the function (which seems only ever to return 1 keystroke)
those remaining in @DATA

Mouse_Definition_Sub
This is the commuter program for the mouse environment window which is
therefore of no use to the developer It is interesting to note that my
mouse always claims to be a bus mouse when it is in fact a serial mouse
Currently it is unsure whether this is due to a bug in the mouse driver or
in MOUSE_SUBS

Mouse_Subs
This is an assembler subroutine that takes 8 parameters As WITH other
assembler programs the purpose of each parameter can change FROM call to
call but basically the first parameter is the code or action to be taken
and the eighth is a result flag (set to 1 for success 0 for failure) The
codes that have been identified thus far along WITH their operands are
presented below (see Note 1 for information regarding XPos and Ypos)

ÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄ
Code³ Description ³ XPos ³ YPos ³4th Var³5th Var³ Key ³ # of ³ Flag
³ ³ ³ ³ ³ ³ Pressed³ Buttons³
ÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ
0 ³ Get Number ³ n/a ³ n/a ³ n/a ³ n/a ³ n/a ³ # of ³ 1/0
³ of Buttons ³ ³ ³ ³ ³ ³ Buttons³
ÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ
3 ³ Get Mouse ³ Xpos ³ YPos ³ n/a ³ n/a ³ Mouse ³ n/a ³ 1/0
³ Location ³ ³ ³ ³ ³ Key ³ ³
³ ³ ³ ³ ³ ³ Pressed³ ³
³ ³ ³ ³ ³ ³(Note 2)³ ³
ÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ
4 ³ Update Mouse³ Xpos ³ Ypos ³ n/a ³ n/a ³ n/a ³ n/a ³ 1/0
³ Location ³ ³ ³ ³ ³ ³ ³
ÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ
15 ³ Set Motion ³XRatio ³YRatio ³ n/a ³ n/a ³ n/a ³ n/a ³ 1/0
³ to Pixel ³(1 to ³(1 to ³ ³ ³ ³ ³
³ Ratios (ie ³32767) ³32767) ³ ³ ³ ³ ³
³ sensitivity ³ ³ ³ ³ ³ ³ ³
³ higher the ³ ³ ³ ³ ³ ³ ³
³ X and Y the ³ ³ ³ ³ ³ ³ ³
³ lower the ³ ³ ³ ³ ³ ³ ³
³ sensitivity)³ ³ ³ ³ ³ ³ ³
ÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ
36 ³ Get Version ³Integer³Decimal³ n/a ³ n/a ³ n/a ³ n/a ³ 1/0
³ Number of ³portion³portion³ ³ ³ ³ ³
³ Mouse Driver³of ³of ³ ³ ³ ³ ³
³ ³version³version³ ³ ³ ³ ³
ÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄ


Note 1 Please note that these X and Y positions are not DIRECTLY related
to the position on SCREEN but rather are RELATED to the last X/Y position of
the mouse This can be tested against the previous VALUE stored in labelled
common (q v ) Normally a 0 25:1 correlation between X/Y position and
XPos/YPos value (eg XPos = 24 X = 6) can be obtained by initialising the
values to 0 USING a 4 call and resetting them to the maximum when the
maximum is exceeded

Note 2 The Mouse Key Pressed will be an INTEGER corresponding to fields 1
through 7 of the Mouse Record in LABELLED common (q v )

As an EXAMPLE of how Mouse_Subs may be used DIRECTLY consider the section
of code on the PAGE following It is designed to be used when the mouse
driver has already been installed and simply indicates on screen what is
happening to the CURSOR

%%MOUSEVARS%%
%%MOUSEVARS%% is a system LABELLED common area having FOUR VARIABLES as
follows

common /%%MOUSEVARS%%/ A B C D

where

A The last X position reported by the mouse driver
B The last Y position reported by the mouse driver
C Set to true if the mouse is ACTIVE FALSE otherwise
D The CURRENT Mouse Details a FIELD MARK delimited DYNAMIC array
having the following structure

< 1 > Key DEFINITION for left mouse button
< 2 > Key definition for right mouse button
< 3 > Key definition for left and right mouse buttons together
< 4 > Key definition for centre mouse button
< 5 > Key definition for left and centre mouse buttons together
< 6 > Key definition for right and centre mouse buttons together
< 7 > Key definition for all THREE mouse buttons together
< 8 > Mouse TYPE (?)
< 9 > X Ratio
< 10 > Y Ratio
< 11 > Multivalued ARRAY having 6 values each value being the X
pixel to character ratio for
< 11 1 > Windows
< 11 2 > Editor
< 11 3 > Pop Ups
< 11 4 > Menus
< 11 5 > Paint
< 11 6 > Default
< 12 > Multivalued array having 6 values each value being the Y
pixel to character ration WITH a STRUCTURE as < 11 >
< 13 > Not used on the mouse tested
< 14 > Mouse software version
< 15 > Number of buttons on the mouse

LX = 0 ; LY = 0 ; DUMMY = 0 ; XPOS = 0 ; YPOS = 0
BUTTON_PRESSED = 0 ; FLAG = 0 ; EXIT_SET = 0
print @(0 0) :
* Tell mouse driver where it is
CALL MOUSE_SUBS( 4 1 1 DUMMY DUMMY BUTTON_PRESSED DUMMY FLAG)
loop
* check X and Y positions
CALL MOUSE_SUBS_RTI( 3 XPOS YPOS DUMMY DUMMY BUTTON_PRESSED DUMMY
> FLAG)
until EXIT_SET do
CHANGED = 0
if XPOS > LX then
print @(0 0) : "Moving Right" "L#20"
CHANGED = 1
end else
if XPOS < LX then
CHANGED = 1
print @(0 0): "Moving Left" "L#20"
end
end
if YPOS > LY then
CHANGED = 1
print @(0 0) : "Moving Down" "L#20"
end else
if YPOS < LY then
CHANGED = 1
print @(0 0): "Moving Up" "L#20"
end
end
if CHANGED then
/*
Note that there is a 4:1 relationship between XPOS and YPOS and
screen positions Remove previous screen marker then print current
*/
print @(LX/4 LY/4): " "
print @(xpos/4 ypos/4): "*" : @(xpos/4 ypos/4) :
end
LY = YPOS
LX = XPOS
if BUTTON_PRESSED then
print @(0 0) : "Key " : BUTTON_PRESSED "L#20"
if button_pressed = 3 then
/*
Note this means that for a standard 2 button mouse both buttons have
been pressed at once indicating Quit!
*/
BUTTON_PRESSED = ""
@DATA = ""
stop
end
BUTTON_PRESSED = ""
end
repeat


(Volume 3 Issue 7 Pages 12 15)
[revmedia/copyrigh.htm]

Page last modified: 31/01/03