Edited wx.grid and keyboard

Tim Roberts wrote:

raffaello wrote:

Having been born many decades ago, I still belong to the ancient tribe of the ones who like the keyboard and not so much mice.

Me, too.

So I wrote a little code to open the cell editor without moving my hands off the keys, and from there to pass to another cell the same way. You will find this code here below if you wish to copy it.

BTW, I chose the keys combination of Control + Print (keycode 321) to open the cell editor, and of Alt + Control + {314: arrow left, 316: arrow right, 315: arrow up, 317: arrow down} for leaving it. But if anybody can suggest some more rational or comfortable combination, I shall gladly comply.

The usual key for "edit this cell" is F2. That's what all of the Windows spreadsheet apps use, including Excel. Then Enter commits the changes and exits the editor, and Esc discards the changes and exits the editor.

The wx.grid should already be supporting the above keys (F2, Esc and Enter) and also it allows Tab to complete and exit the cell editor but moves to the next cell to the right instead of the next cell down (although if you have the grid on a panel with other widgets then the Tab can get stolen for navigation) and also most cell editor types will allow you to move to the cell and start typing to engage the cell editor. So yes Raffaello, you've reinvented boiled eggs. :wink:

ยทยทยท

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!