# Underlying Keystroke Processing

Learn how the Spread component utilizes underlying Windows keystroke processing and provides methods and events for handling keyboard input in .NET Framework.

## Content

The Spread component builds its keystroke processing on top of the underlying Windows keystroke processing.
The **System.Windows.Forms.Control** class provides the following methods and events for processing keystrokes that occur while the component has focus:

* **IsInputKey** method
* **IsInputChar** method
* **OnKeyDown** method
* **OnKeyPress** method
* **OnKeyUp** method
* **KeyDown** event
* **KeyPress** event
* **KeyUp** event

The **System.Windows.Forms.Control** class provides the following methods for processing keystrokes that occur while the component or one of its child controls has focus:

* **ProcessDialogKey**
* **ProcessDialogChar**

In addition to the methods and events in the .NET Framework that handle keyboard input, the Spread component provides input maps, as described in [Default Keyboard Maps](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-defaultmaps). Input maps provide a table-based description of the keyboard behavior for a Spread component. This allows the application to query the keyboard behavior for a Spread component. An input map is essentially a collection of keystrokes and related actions.
The Spread component provides a **WhenFocused** input map for processing keystrokes that occur while the component has focus. The **WhenFocused** input map is used to implement the [FpSpread](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.html) class **IsInputKey**, **IsInputChar**, **OnKeyDown**, **OnKeyPress**, and **OnKeyUp** methods which in turn raise the **KeyDown**, **KeyPress**, and **KeyUp** events.
The Spread component provides a **WhenAncestorOfFocused** input map for processing keystrokes that occur while the component or one of its child controls has focus. The **WhenAncestorOfFocused** input map is used to implement the [FpSpread](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.html) class's **ProcessDialogKey** and **ProcessDialogChar** methods. These methods do not raise any events. Most keystrokes processed by the Spread component must be processed whether the component or one of its child controls have focus, which means that most of the Spread keyboard behavior is described in the **WhenAncestorOfFocus** input map.

> !type=note
> 
> **Note:** When keystrokes are processed by the **ProcessDialogKey** and **ProcessDialogChar** methods, no events are raised. This is true of most other grid-like components, including the Microsoft DataGrid.

The Spread component has multiple operation modes (Normal, ReadOnly, RowMode, SingleSelect, MultiSelect, ExtendedSelect). Each operation mode requires different keyboard behavior. Therefore, the Spread component has separate **WhenFocused** and **WhenAncestorOfFocused** input maps for each operation mode, as listed in the topic [Default Keyboard Maps](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-defaultmaps). For more discussion of these, refer to [Factors of Keyboard Map Usage](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-factors).
The predefined actions available for the Spread component are in the [SpreadActions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SpreadActions.html) class. For a complete list of actions (including actions that do not have default keys), refer to the [SpreadActions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SpreadActions.html) class.
If you want to turn off one of the default map keystroke settings, you can set the keystroke to the **None** member of the [SpreadActions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SpreadActions.html) class.
For more information about the programming interface for inputs and actions and maps, refer to these classes:

* [Action](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.Action.html) class
* [ActionMap](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.ActionMap.html) class
* [InputMap](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.InputMap.html) class
* [KeyStroke](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.Keystroke.html) class
* [SpreadActions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SpreadActions.html) class

## See Also

[Keyboard Interaction](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys)
[Factors of Keyboard Map Usage](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-factors)
[Default Keyboard Navigation](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-keybdnav)
[Default Keyboard Maps](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-defaultmaps)
[Deactivating the Default Keyboard Map](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-defaultoff)
[Changing the Default Keyboard Map](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-defaultnew)
[Using Input Maps with Action Maps](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-action)
[Customizing the Input Maps](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-custominput)
[Changing an Input Map for a Child View](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-child)
[Saving and Loading Map Files](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-load)
[Using the Excel Compatibility Input Maps](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-using)