NAME

ncurses – a module for Tensile (see
sl(1))

OVERVIEW

This module provides interface to *nix (n)curses library. It does not do direct binding, but rather uses Tensile streams interface

FUNCTIONS

sysvar ncurses module adds the following system variables (read-only):

feature

ncurses adds the following features:

curses.mousemask([mask])

if mask is present, sets the current terminal mouse event mask to mask

The mask has the following form:

+|-|(modifier | event-type button-no)*

or all or *

where modifier is one of
p
– a button is pressed
r
– a button is released
c
– a button is clicked
d
– a button is double clicked
t
– a button is triple clicked
and the modifier is one of:
C
– a Control key is pressed
S
– a Shift key is pressed
A
– an Alt key is pressed
m
– report mouse motions, not just button state change
There are at most four buttons recognized.

all and * are equivalent to p1p2p3p4r1r2r3r4c1c2c3c4d1d2d3d4t1t3t4CSA

If a mask starts with , a new mask is a logical OR of the old mask and mask; if mask starts with a , a new mask is logical AND of the old mask and mask complement; otherwise, the mask is set to mask.

RETURNS:the old mask
NOTE:this function is always present, even if the library doesn't support mice

WINDOW STREAM

Reading

ASCII characters read from the terminal are returned as is. Special keys are read as KEY tag which has two attributes: NAME holding the name of the key or UNKNOWN if the key is not recognized; and CODE holding the internal key of the code.

Key names are those defined by curses(3) without the leading KEY_ (but functional key names are just Fnumber without parentheses

If the mouse is present, supported and enabled, mouse events are read as MOUSE tag which has the following attributes:

STATE
state of buttons in the same form as mousemask
SCREENX
horizontal position of the mouse pointer relative to screen
SCREENY
vertical position -"-
X
horizontal position of the mouse pointer relative to the window; not present if the pointer is outside the window
Y
vertical position -"-
Z
a Z coordinate of the pointer (currently always 0)

Writing

ASCII characters are written as is. The following tags are recognized:
BORDER
draws a border around the window
CLEAR
clear the window
MOVE
moves the cursor to X, Y; or offset to DX, DY
HLINE
draws a horizontal line from the cursor of the length LEN
VLINE
draws a vertical line -"-
STANDOUT
turns on standout hiliting
/STANDOUT
turns it off
BOLD
turns on bold hiliting
/BOLD
turns it off
&
writes a special character whose name is VALUE Character names are the same as defined by curses(3) without the leading ACS_ In addition, LEQUAL, GEQUAL, NEQUAL, S3, S7, PI and STERLING are ASCII approximated if the library lacks them

Ioctls

The following ioctls are recognized:
flush
actually draws the screen
scrollok
enables scrolling of the window
noscrollok
disables -"-

Positioning

getpos on a window stream will the following value: win_width * ypos + xpos

Resp. setpos will convert such number to a coordinate pair

rewind will move the cursor to the top left corner

Crearing window streams

The type of window streams is window The arg is X-like geometry specification:
width x height [[+|-] xpos] [[+|-] ypos]

SEE ALSO

curses(3), sl(1)

AUTHOR

Artem V. Andreev

COPYRIGHT

Copyright © 2001, 2002 Artem V. Andreev. See
sl(1) for details