# Customizing the Input Maps

Learn how to customize input maps for Spread component actions in this comprehensive guide. Find out how to map any key or key combination to specific actions for enhanced user experience.

## Content

You can use the default navigation keys that are mapped to Spread actions. You can also customize these input maps so that any key or key combination can map to any Spread component action.
Be sure to read [Factors of Keyboard Map Usage](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-factors).
The available actions to which you can map keys or key combinations are provided in the [SpreadActions](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SpreadActions.html) class.
The default maps create the default navigation and action keys listed in [Default Keyboard Maps](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-defaultmaps). These maps are for the default operation mode, Normal. Other maps are provided for other operation modes. Be sure to set the map for the operation mode in which your component is working when customizing input maps. For more information about default values of the various modes, refer to [Default Keyboard Maps](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-defaultmaps). Input maps work differently depending on the current focus.
For more detailed descriptions of input maps, refer to the [InputMap](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.InputMap.html) class.
The **Properties** window does not have options to customize input maps.

## Using Code

1. Create a new [InputMap](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.InputMap.html) object for which to map keys and actions.
2. Set an existing input map equal to the [InputMap](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.InputMap.html) object you created.
3. Use the [InputMap](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.InputMap.html) class **Put** method to map specific keys to specific actions.

## Example

This example code sets the input map for operation mode Normal for both the object with focus and its ancestor. This example sets the Enter key to always move to the next row.

```csharp
// Create an InputMap object.
FarPoint.Win.Spread.InputMap inputmap1;
// Assign the InputMap object to the existing map.
inputmap1 = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused);
// Map the Enter key.
inputmap1.Put(new FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextRow);
// Create another InputMap object.
FarPoint.Win.Spread.InputMap inputmap2;
// Assign this InputMap object to the existing map.
inputmap2 = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused);
// Map the Enter key.
inputmap2.Put(new FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextRow);
```

```vbnet
' Create an InputMap object.
Dim inputmap1 As New FarPoint.Win.Spread.InputMap()
' Assign the InputMap object to the existing map.
inputmap1 = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused)
' Map the Enter key.
inputmap1.Put(New FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextRow)
' Create another InputMap object.
Dim inputmap2 As New FarPoint.Win.Spread.InputMap()
' Assign this InputMap object to the existing map.
inputmap2 = fpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenFocused)
' Map the Enter key.
inputmap2.Put(New FarPoint.Win.Spread.Keystroke(Keys.Enter, Keys.None), FarPoint.Win.Spread.SpreadActions.MoveToNextRow)
```

## Using the Spread Designer

1. In the **Settings** menu, click the **Input Map** icon under the **Other Settings** section.
2. Select the input map, key, and action.
3. Add the new key and action.
4. Select **OK**.
5. From the **File** menu choose **Apply and Exit** to apply your changes to the component and exit Spread Designer.

## See Also

[Keyboard Interaction](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys)
[Underlying Keystroke Processing](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-mappingkeys/spwin-maps-keysyswin)
[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)
[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)