1
0
mirror of synced 2026-01-12 00:42:56 +00:00
Interlisp.medley/lispusers/WHEELSCROLL.TEDIT
rmkaplan 1bdaa63d49
WHEELSCROLL: Put more of the branching logic inside the WHEELSCROLL function, add character names (#2069)
Put more of the branching logic inside WHEELSCROLL, add character names
2025-03-24 10:19:06 -07:00

51 lines
5.7 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Medley WHEELSCROLL
2
4
1
WHEELSCROLL
1
4
By Ron Kaplan
This document was last edited in March 2025.
This small file adds the ability to scroll (scrollable) windows by rotating the wheel on a wheel mouse or by moving (2?) fingers on a track pad. The capability is enabled when WHEELSCROLL.LCOM is loaded. It is toggled on and off by
(ENABLEWHEELSCROLL ON) [Function]
Initially (ENABLEWHEELSCROLL T).
The vertical scrolling speed is controlled by the variable
WHEELSCROLLDELTA [Variable]
The number of points to scroll for each click of the wheel. Higher values give faster scrolling. A negative value reverses the scrolling direction. Initially value: 20.
HWHEELSCROLLDELTA [Variable]
If non-NIL, this is the delta used for horizontal scrolling.
Implementation:
WHEELSCROLL assigns and exports character names for four new characters currentlywith these character codes:ÿÿ
ÿ WHEELSCROLL-UP 156ÿÿ
ÿ WHEELSCROLL-DOWN 157ÿÿ
ÿ WHEELSCROLL-LEFT 158ÿÿ
ÿ WHEELSCROLL-RIGHT 159ÿÿ
ÿThese are codes in the upper panel of character set 0 that correspond to the highest control characters and thus come through the keyboard unchanged whether not the control key is down. (At some point in the future we expect to translate these names to a private-use region of both the MCCS and Unicode code spaces).
If no other keys are down, Lisp receives a key transition on PAD1 or PAD2 when the wheel rotates for vertical scrolling and PAD4 and PAD5 when horizontal scrolling is signaled. (ENABLEWHEELSCROLL T) modifies the keyaction table so that it maps these transitions to the appropriate WHEELSCROLL-* values. Those characters are defined as interrupts that invoke the vertical scrolling or horizontal scrolling actions, respectively.
(ENABLEWHEELSCROLL NIL) causes PAD1, PAD2, PAD4, and PAD5 to be ignored.
The actual scrolling actions are implemented by the function
(WHEELSCROLL DIRECTION DELTA/POS) [Function]
DIRECTION is either VERTICAL or HORIZONTAL. DELTA/POS is either a point value for scrolling that a client wants to specify in a particular context, or a flag that indicates whether the default magnitude defined by WHEELSCROLLDELTA or HWHEELSCROLLDELTA should be applied. If the flag is T the window scrolls with the current value of those variables, otherwise the negative of those values.
WHEELSCROLL is called by the interrupt characters, but applications that run with interrupts turned off (like Tedit) may need to call WHEELSCROLL directly when any of the WHEELSCROLL-* characters is encountered.
WHEELSCROLL does nothing if wheel scrolling has not been enabled.
Current unfortunate behavior:
When the wheel is depressed for middle-button effect (and no other keys are down), an accidental rotation of the wheel during the transition (up and/or down) may cause unintended scrolling.
We need to develop a strategy, either in Lisp, Maiko, or X, to discriminate intended middle-button pushes from intended scrolling. This is not an issue for track-pad scrolling.
(SEQUENCE NIL NIL (0 0 0 0) ((PAGE NIL (PAPERSIZE NIL) (0 0 612 792) ((TEXT NIL NIL (72 72 468 648) NIL))) (ALTERNATE NIL NIL (0 0 0 0) ((PAGE NIL (PAPERSIZE NIL) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD LEFT) CHARLOOKS (FONT {TEDIT-FONTCLASS/174,6620} INVERTED OFF UNDERLINE OFF STRIKEOUT OFF OVERLINE OFF UNBREAKABLE OFF PROTECTED OFF SELECTPOINT OFF INVISIBLE OFF STYLE NIL USERINFO NIL) FORMATINFO NIL) (72 756 288 36) NIL) (TEXT NIL NIL (72 72 468 648) NIL))) (PAGE NIL (PAPERSIZE NIL) (0 0 612 792) ((FOLIO NIL (PARALOOKS (QUAD RIGHT) CHARLOOKS (FONT {TEDIT-FONTCLASS/174,6760} INVERTED OFF UNDERLINE OFF STRIKEOUT OFF OVERLINE OFF UNBREAKABLE OFF PROTECTED OFF SELECTPOINT OFF INVISIBLE OFF STYLE NIL USERINFO NIL) FORMATINFO NIL) (252 756 288 36) NIL) (TEXT NIL NIL (72 72 468 648) NIL)))))))
1$4È$È4È $È:È$0ºÈ1$7È$¢È1È$1ŠŠ8$1ŠŠ8$JÈ$È PAGEHEADING RUNNINGHEADMODERN
CLASSIC
dV(TEDIT-FONTCLASS 0 (MODERN 10 BRR) NIL NIL (POSTSCRIPT (MODERN 10)) (PDF (MODERN 10)))
TERMINAL
MODERN
MODERN 
TIMESROMAN$


 HRULE.GETFN HRULE.GETFN HRULE.GETFN   HRULE.GETFN HRULE.GETFN-°( 
;
¬ = a@=iS
Š=!   
 ¡ | 
 7¾²DATE:i Äh ·