Why does TSynEdit not detect Tab key pressed?

176 Views Asked by At

This is my first question, I hope it will be a well constructed one.

I'm currently using Delphi 10.4 Community Edition and I installed SynEdit through the GetIt Package Manager.

The problem I'm facing is the following: I created a VCL form, dropped a TSynEdit in it and launched the application. The problem is that if I press the TAB or SHIFT+TAB, nothing happens. I tried to put breakpoints in the following methods of TSynEdit:

  • CommandProcessor
  • ExecuteCommand
  • DoTabKey

and the debugger never enters them while pressing those keys.

I then looked at the Keystrokes property of my TSynEdit control and, although the keystroke for TAB is defined, I think that the shortcut is "fake". What I mean is that if I try to modify what is associated to the ecTab command and manually choose the shortcut value, nor Tab or Shift+Tab are present in the listbox.

Did anyone ever experienced a problem like this? If so, how did you manage to solve it?

PS: Indentation works with other shortcuts, such as CTRL+SHIFT+I/U.

1

There are 1 best solutions below

0
NihmarIsProgramming On

As indicated by Keith Miller, it was as simple as setting to True the property WantTabs for the TSynEdit control.

Still, if anyone knows why the TAB and SHIFT+TAB shortucts don't appear in the listbox of selectable shortcuts, please let us know.