Reputation: 847
As described here, RichEdit controls have a lot of built-in shortcuts for various functions.
I have TRichEdit
controls in a Delphi 7 application where I would like to remove some (but probably not all) of those shortcuts. There is no such method described in msdn.
I am currently simply using OnKeyDown
and OnKeyUp
event handlers for this purpose, but this isn't a very elegant solution, since I have to add code for every TRichEdit
control, and often I'm adding OnKeyDown
and OnKeyUp
event handlers only for this.
I would like to implement a more elegant solution that deals with those shortcuts globally, like using an interceptor class, but I don't know how to intercept and discard those shortcuts. Any ideas?
Upvotes: 1
Views: 882
Reputation: 612904
You could add your own shortcut handlers that do nothing. Add an action list and add an action. Use the action's ShortCut
and SecondaryShortCuts
properties to hijack the shortcuts you are targeting. Add on OnExecute
handler for the action that does nothing, or perhaps beeps to indicate an un-handled short cut.
I don't know for sure that this will work having never tried it, but I believe it should.
Upvotes: 1