Table of Contents

Method ProcessKey

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

ProcessKey(KeyEvent)

If the view is focused, gives the view a chance to process the keystroke.

public virtual bool ProcessKey(KeyEvent keyEvent)

Parameters

keyEvent KeyEvent

Contains the details about the key that produced the event.

Returns

bool

Remarks

Views can override this method if they are interested in processing the given keystroke. If they consume the keystroke, they must return true to stop the keystroke from being processed by other widgets or consumed by the widget engine. If they return false, the keystroke will be passed using the ProcessColdKey method to other views to process.

The View implementation does nothing but return false, so it is not necessary to call base.ProcessKey if you derive directly from View, but you should if you derive other View subclasses.