Interface IEventPump
Defines the traits needed to implement EventPump.
Namespace: Sharpie.Abstractions
Assembly: sharpie.dll
Syntax
[PublicAPI]
public interface IEventPump
Properties
Terminal
The terminal this pump belongs to.
Declaration
ITerminal Terminal { get; }
Property Value
Type | Description |
---|---|
ITerminal |
Methods
Listen()
Gets an enumerable that is used to get enumerate events from Curses as they are generated.
Declaration
IEnumerable<Event> Listen()
Returns
Type | Description |
---|---|
IEnumerable<Event> | The event listening enumerable. |
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
Listen(ISurface)
Gets an enumerable that is used to get enumerate events from Curses as they are generated.
Declaration
IEnumerable<Event> Listen(ISurface surface)
Parameters
Type | Name | Description |
---|---|---|
ISurface | surface | The surface to refresh during event processing. |
Returns
Type | Description |
---|---|
IEnumerable<Event> | The event listening enumerable. |
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
Listen(ISurface, CancellationToken)
Gets an enumerable that is used to get enumerate events from Curses as they are generated.
Declaration
IEnumerable<Event> Listen(ISurface surface, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
ISurface | surface | The surface to refresh during event processing. |
CancellationToken | cancellationToken | Cancellation token used to interrupt the process. |
Returns
Type | Description |
---|---|
IEnumerable<Event> | The event listening enumerable. |
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
Listen(CancellationToken)
Gets an enumerable that is used to get enumerate events from Curses as they are generated.
Declaration
IEnumerable<Event> Listen(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Cancellation token used to interrupt the process. |
Returns
Type | Description |
---|---|
IEnumerable<Event> | The event listening enumerable. |
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
Use(ResolveEscapeSequenceFunc)
Registers a key sequence resolver into the input pipeline.
Declaration
void Use(ResolveEscapeSequenceFunc resolver)
Parameters
Type | Name | Description |
---|---|---|
ResolveEscapeSequenceFunc | resolver | The resolver to register. |
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown is |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |
Uses(ResolveEscapeSequenceFunc)
Checks if the screen has a given key sequence resolver registered.
Declaration
bool Uses(ResolveEscapeSequenceFunc resolver)
Parameters
Type | Name | Description |
---|---|---|
ResolveEscapeSequenceFunc | resolver | The resolver to check. |
Returns
Type | Description |
---|---|
bool |
|
Remarks
This operation is not thread safe.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown is |
CursesSynchronizationException | Thrown if this operation was expected to run on the main thread/context but wasn't. |