[Lazarus] Disabling TAction while typing

Michael Van Canneyt michael at freepascal.org
Fri Oct 7 20:34:08 CEST 2011



On Fri, 7 Oct 2011, Leonardo M. Ramé wrote:

> Hi, I have a form with an ActionList, and some actions have
> single-character shortcuts. For example, when the user type the
> character "o" it execute an action.
>
> Also, in some situations, I have to place a TEdit on a TPanel over the
> main form. The problem is, when I type a word containing "o", the action
> is executed, instead of placing that character in my TEdit.
>
> How can I disable actions while typing in TEdit?.

The whole point of actions is that they are active all the time ?

What you can try to do is to use the 'OnUpdate' handler, and check if the 
focus is in an edit control, and if so, disable the action. But then you'll 
never be able to execute the action.

In general, I doubt that a single-character shortcut is a good idea if you 
need to be able to type in edits...

Michael.


More information about the Lazarus mailing list