class

TermBuf::Input::Patterns

Inherits Reference < Object

The sequences an application is currently interested in.

Empty by default, which is the useful default: with nothing registered every escape sequence arriving from the terminal is something the person at the keyboard pressed.

Guarded, because registration happens wherever the application is while matching happens on the fibre that owns the decoder.

Constructors

Instance methods

clear

Stops watching for anything.

Source
empty?

Whether nothing is registered, in which case every sequence is input.

Source
match(sequence : Sequence) : Event | Nil

What the first interested pattern makes of sequence, or nil when none of them wanted it and it is therefore input.

Source
register(prefix : Prefix, head : String = "", terminator : String | Nil = nil, &handler : Sequence -> Event | Nil) : Pattern

Starts watching for a sequence with this shape.

Source
register(pattern : Pattern) : Pattern

Starts watching for a sequence with this shape.

Source
size

How many patterns are registered.

Source
unregister(pattern : Pattern) : Nil

Stops watching for pattern.

Source