Spread Windows Forms 6.0 Product Documentation
Customizing the Input Maps
Support Options
Spread Windows Forms 6.0 Product Documentation > Developer's Guide > Managing Keyboard Interaction > Customizing the Input Maps

Glossary Item Box

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.

The available actions to which you can map keys or key combinations are provided in the SpreadActions class.

The default maps create the default navigation and action keys listed in Default Keyboard Maps. 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. Input maps work differently depending on the current focus.

For more detailed descriptions of input maps, refer to the InputMap class.

The Properties window and the Spread Designer do not have options to customize input maps.

Return to Managing Keyboard Interaction.

Using Code

  1. Create a new InputMap object for which to map keys and actions.
  2. Set an existing input map equal to the InputMap object you created.
  3. Use the InputMap 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 cell.

C# Copy Code
// 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);
 
VB Copy Code
' 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)
 

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.