TC_Txed_SetTrapChar doesn't seem to work

According to the Manual, p. 385, TC_Txed_SetTrapChar can be used to specify key board characters to be returned by TC_Event as TXE
KEYPRESS events, even if KEY EVENTS had not been chosen as an option in TC_Txed_Create. However, (1) I can only grab the key in TXE KEYPRESS if KEY EVENTS has been specified when the text editor was created. (2) the "action" option (1,2,or 3) appears to have no effect on whether the key is "absorbed" by the text editor or not, or whether the text editor is suspended or not.

I'm trapping Ctrl+s to use as a keyboard shortcut for saving the document in the text editor. This works when I specify KEY EVENTS when I create the text editor, but, unhappily, the Ctrl+s is placed in the document as well. I'm using version 5.32. Is this a problem that has been fixed since then? (I'm willing to upgrade!)

Since I can't use TC_Txed_SetTrapChar to prevent Ctrl+s from appearing in the text editor document, is there some other way to work around this problem?

Thanks in advance for your help.

Bill Roberts


Txed control

Hi Bill,

If you followed some of my bug reports and the development of the new editor, you will know that I discovered the hard way (like you) that the TextEdit control has a whole series of bugs. Sadly the situation doesn't get any better with newer versions. In fact version 5.5b19 (the latest) is considerably worse. It not only has the bugs that you found but a whole lot more. For example, some upper case letters are not passed back as ASCii numbers.

The basis of the new editor is the Text Edit control, so for me, developing a new editor, it was critical that the TextEdit control should work properly. I managed to work around many bugs but the bugs associated with KEY EVENTS and SetTrapChar are embedded in the Sys_event routine and not in TrueCtrl. In the end I gave up, and wrote my own version of the TextEdit control. My simple solution to the problems you encountered is to pass back ALL keystrokes regardless of KEY EVENTS and let the user decide if they want to use the information.

My version of the TextEdit control is included in the new editor (soon to be released). It will also be included in the next release of the CTX library module available from my web site.

Big John