[Lazarus] Handle user inputs

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jan 21 09:34:33 CET 2013

On Mon, 21 Jan 2013 07:16:27 +0008
xrfang <xrfang at gmail.com> wrote:

> Hi,
> I want to use TApplicationProperties.OnUserInput to process keyboard/mouse events.  But the parameter of this method is a Cardinal. 
> My questions are:
> 1) How do I know its event type, such as keydown/keyup/keypress or mouse move etc?

if Msg=LM_KEYDOWN then ...

> 2) How do I know the actual key that is pressed, or the X, Y coordinates of the mouse?

To interpret key and coordinates correctly you need the context.
If you want context-specific events then you have to use the
events of the context, e.g. the form, button, etc.


More information about the Lazarus mailing list