Managing Keyboard

Posted by: pansy18 on 8 September 2017, 12:38 pm EST

  • Posted 8 September 2017, 12:38 pm EST

    I have a sheet (30 rows and 25 columns) and on it have a cell with type is button. This sheet is placed in a from. On this form has 'Start' button and a combo box with three speed values:  Hight, Slow and  Medium. When I choose one speed and click Start button, button on sheet will go down bellow rows with chose speed, and i can use Left/Right/Down to control direct of button on sheet. If button down to row 30 a the process will be paly again. I don't know how to use Keyboard to control button on the sheet?  Please, give me an Ideal to solve this  problem.
    Thank you so much!

  • Replied 8 September 2017, 12:38 pm EST

    What are you wanting to happen when you reach the last row?  Could you attach a small example showing what you are doing and explain what you would like the behavior to be?
  • Replied 8 September 2017, 12:38 pm EST

    Do you know about this Game! I want to use Keyboard Left/Right/Down to control direction of  these blocks and Space to rotate them. When a row full of these blog, it will be remove and score will be increase 10 point.
    In this game I want to managing keyboard interaction to develop.


    2007/07/video.rar
  • Replied 8 September 2017, 12:38 pm EST

    I am not familiar with that game.  Again, could you put together a small project that explains what you want to do.   You should be able to move the buttons programatically in one of the key events, but this is not going to be an easy thing to do.
  • Replied 8 September 2017, 12:38 pm EST

    Hello,


    You would need to turn off the preprocessing of these keystrokes in the Spread. Then the keystroke will work it's way to the parent form and you can catch it in the ProcessDialogKey override for the parent form. To turn off Spread's preprocessing of the keystrokes, you need to use the InputMap and set the SpreadAction assigned to the keystroke to None. Here is sample code showing how to catch these keystrokes in the Spread.

     
      Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    FpSpread1.Sheets(0).OperationMode = FarPoint.Win.Spread.OperationMode.ReadOnly
    Dim
    im As FarPoint.Win.Spread.InputMap
    im = FpSpread1.GetInputMap(FarPoint.Win.Spread.InputMapMode.WhenAncestorOfFocused, FarPoint.Win.Spread.OperationMode.ReadOnly)
    im.Put(New FarPoint.Win.Spread.Keystroke(Keys.Down, Keys.None), FarPoint.Win.Spread.SpreadActions.None)
    im.Put(New FarPoint.Win.Spread.Keystroke(Keys.Left, Keys.None), FarPoint.Win.Spread.SpreadActions.None)
    im.Put(New FarPoint.Win.Spread.Keystroke(Keys.Right, Keys.None), FarPoint.Win.Spread.SpreadActions.None)
    im.Put(New FarPoint.Win.Spread.Keystroke(Keys.Space, Keys.None), FarPoint.Win.Spread.SpreadActions.None)
    End Sub

    Protected Overrides Function
    ProcessDialogKey(ByVal keyData As System.Windows.Forms.Keys) As Boolean
    TextBox1.Text = keyData
    Return MyBase.ProcessDialogKey(keyData)
    End Function
     
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels