10287 : Deleting links by keyboard. Key events does not fire.

Question

I want to  delete a link when the user presses a key. Ive implemented all the key_down/key_up/on_datescaler_key_up/… events, but none of them seems to fire.

Answer

In order for a control to actually receive and handle the key events it must be focused. If you were to add this line in a TimeItemArea MouseDown event: Gantt1.TimeItemArea.Focus(), you will find that the key events are executed as expected.

Another good way to get key events would be to add a context menu and add shortcut-keys to the menuitems.

(We have key handling on our list for future development, we will implement key navigation in datescaler and to jump between time items etc.)

 

Leave a Reply