Lugaru's Epsilon

Epsilon User's Manual and Reference
   Commands by Topic
      The Screen
         . . .
            Creating Windows
            Removing Windows
            Selecting Windows
            Resizing Windows
         Customizing the Screen
            Cursor Shapes
         . . .

Previous   Up    Next
Customizing the Screen  Commands by Topic   Fonts

Epsilon User's Manual and Reference > Commands by Topic > The Screen > Customizing the Screen >

Cursor Shapes

You can set variables to modify the text cursor shape Epsilon displays in different situations. Epsilon gets the cursor shape from one of four variables, depending upon whether or not Epsilon is in overwrite mode, and whether or not the cursor is positioned in virtual space. (See the description of the virtual-space variable in Simple Movement Commands.) These variables only apply in text mode, not in Epsilon for Windows or under X11 in Unix, and in some environments have no effect.

 Variable  In overwrite mode?  In virtual space?
 normal-cursor  No  No
 overwrite-cursor  Yes  No
 virtual-insert-cursor  No  Yes
 virtual-overwrite-cursor  Yes  Yes

Each of these variables contains a code that specifies the top and bottom edges of the cursor, such as 3006, which specifies a cursor that begins on scan line 3 and extends to scan line 6 on a character box. The topmost scan line is scan line 0.

Scan lines above 50 in a cursor shape code are interpreted differently. A scan line number of 99 indicates the highest-numbered valid scan line (just below the character), 98 indicates the line above that, and so forth. For example, a cursor shape like 1098 produces a cursor that extends from scan line 1 to the next-to-last scan line, one scan line smaller at top and bottom than a full block cursor.

The Windows and X11 versions of Epsilon use a similar set of variables to control the shape of the cursor (or caret, in Windows terminology).

 Variable  In overwrite mode?  In virtual space?
 normal-gui-cursor  No  No
 overwrite-gui-cursor  Yes  No
 virtual-insert-gui-cursor  No  Yes
 virtual-overwrite-gui-cursor  Yes  Yes

Each variable contains a code that specifies the height and width of the caret, as well as a vertical offset, each expressed as a percentage of the character dimensions. Values close to 0 or 100 are absolute pixel counts, so a width of 98 is two pixels smaller than a character. A width of exactly zero means use the default width.

All measurements are from the top left corner of the character. A nonzero vertical offset moves the caret down from its usual starting point at the top left corner.

In EEL programs, you can use the GUI_CURSOR_SHAPE( ) macro to combine the three values into the appropriate code; it simply multiplies the height by 1000 and the offset by 1,000,000, and adds both to the width. So the default Windows caret shape of GUI_CURSOR_SHAPE(100, 2, 0), which specifies a height of 100% of the character size and a width of 2 pixels, is encoded as the value 100,002. The value 100100 provides a block cursor, while 99,002,100 makes a good underline cursor. (It specifies a width of 100%, a height of 2 pixels, and an offset of 99 putting the caret down near the bottom of the character cell.) The CURSOR_SHAPE( ) macro serves a similar purpose for text mode versions of Epsilon.

The X11 version of Epsilon can only change the cursor shape if you've provided an Epsilon.cursorstyle:1 resource (see Unix Installation).

Standard bindings:

  Ctrl-F6  set-show-graphic
 Shift-F6  change-show-spaces

Previous   Up    Next
Customizing the Screen  Commands by Topic   Fonts

Lugaru Copyright (C) 1984, 2020 by Lugaru Software Ltd. All rights reserved.