ragardner / tksheet

Python tkinter table widget for displaying tabular data
https://pypi.org/project/tksheet/
MIT License
400 stars 48 forks source link

using the "Supr"/"Del" key in the same way as the "Backspace" key #247

Closed fmerchan65 closed 1 month ago

fmerchan65 commented 1 month ago

The users of my application use the numeric keypad a lot and to delete the contents of a cell they use "Supr"/"Del" key on the numeric keypad more than the "Backspace" key. After several hours of research and testing I have not found the way to do it in a tksheet table.

ragardner commented 1 month ago

I'm not sure I understand sorry, questions:

Is the binding:

Currently:

I am trying to follow the behavior of other spreadsheets and I'm not sure there's any other things Del should do?

fmerchan65 commented 1 month ago

Sorry for the initial explanation. Yes, I mean Del key binding. Could the behavior of this binding be changed in an open cell editor and it would run like backspace key ?. I mean, delete the character just before where the cursor is.

ragardner commented 1 month ago

Thanks for the reply,

As I went about making the change I realized that the tkinter text widget deletes the forward character when there is no selected text

So when there are no selections it currently has the default behavior of:

I have checked the behavior of Libre office and it seems the same there as well

I will add an option to override the behavior

fmerchan65 commented 1 month ago

You are right. It's ok the Del key current behavior. Thanks a lot !

ragardner commented 1 month ago

Hey, in case you're interested I added the following option in 7.2.15:

In your sheet initialization you can use the parameter:

With the following arguments:

e.g. my_sheet = Sheet(parent, editor_del_key="backward")

You can also use the keyword argument with the set_options() function