JZ> I'd like to have just a simple little SUB, that when called, just
JZ> returns the ASCII code of the character currently under the mouse
JZ> pointer in an integer variable I could work with. This would only
JZ> need work in good ol' standard SCREEN 0...
Howdy JOHN,
The code snip at the foot goes a little further and extracts what is between
the arrow brackets "". This will let you take mouse action on prompts
something like: "Press to quit" or "et File Name". If the mouse
cursor is not inside arrow brackets, clicks are ignored.
You may need to adapt the MseClick and MseGetLoc subs to match the mouse
routines you are using. This would normally go inside the loop you use to
collect the next key from the user.
Chris
======================================================
IF Mse% THEN ' Get current mouse button status
CALL MseClick(MLft%, MCen%, MRgt%, Held%)
SELECT CASE Held%
CASE 1: Ki% = 13: Km% = 89: 'Yes (left)
CASE 2: Ki% = 32: Km% = 78: 'No (right)
CASE 3: Ki% = 27: Km% = 27: 'Escape
CASE 4: Ki% = 13: Km% = 88: 'X (middle)
END SELECT
IF MseKey% AND Ki% = 13 THEN
CALL MseGetLoc(MRow%, MCol%, 1)
IF SW% = 80 AND MCol% > 1 AND MCol% < 80 THEN
X$ = SPACE$(80)
FOR X% = MCol% - 10 TO MCol% + 10
IF X% > 0 AND X% < 81 THEN
MID$(X$, X%) = CHR$(SCREEN(MRow%, X%, 0))
END IF
NEXT X%
DO: Lft% = INSTR(Lft% + 1, X$, "")
IF Lft% AND MCol% > Lft% AND MCol% < Rgt% THEN
K$ = MID$(X$, Lft% + 1, Rgt% - Lft% - 1): Ki% = ASC(K$): EXIT DO
ELSE K$ = ""
END IF
LOOP WHILE Lft%
END IF
END IF
--- FMail 0.96â
---------------
* Origin: BIZynet - Worldwide Business via the E-Ways (1:15/55.1)
|