Recent

Author Topic: Besides TForm is there a container component that handles keystrokes?  (Read 1136 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1147
    • HowTos Considered Harmful?
I'm going through the components list in Lazarus to look for a container component like TPanel that handles keystrokes and the only one I can find is TForm.

Is there no other such component than TForm?

On a side note when a TForm is embedded in another are keystrokes in the embedded form seen by the parent form, or are they all trapped by the embedded form?
Lazarus 3.0/FPC 3.2.2

jamie

  • Hero Member
  • *****
  • Posts: 7319
Re: Besides TForm is there a container component that handles keystrokes?
« Reply #1 on: October 04, 2024, 11:06:00 pm »
Application.AddOnUserInputHandler

I don't know what you are trying to do but that should capture it all.

The only true wisdom is knowing you know nothing

mas steindorff

  • Hero Member
  • *****
  • Posts: 560
Re: Besides TForm is there a container component that handles keystrokes?
« Reply #2 on: October 05, 2024, 12:40:09 am »
it's not in the object inspector but TFrames also have .onKey...

just tested the tpanal and it to has these onKey functions
i.e. during the create() function of my frame I typed
self.panel1.onKey.. and auto complete  shows the rest.
« Last Edit: October 05, 2024, 12:50:26 am by mas steindorff »
windows 10 &11, Ubuntu 21+ IDE 3.4 general releases

vfclists

  • Hero Member
  • *****
  • Posts: 1147
    • HowTos Considered Harmful?
Re: Besides TForm is there a container component that handles keystrokes?
« Reply #3 on: October 05, 2024, 03:11:15 pm »
Application.AddOnUserInputHandler

I don't know what you are trying to do but that should capture it all.

Looks like I was introduced to AddOnUserInputHandler 9 years ago https://forum.lazarus.freepascal.org/index.php/topic,27980.msg173805.html#msg173805,

I even found good  example on using it, but I didn't explore it further.

Thanks.
Lazarus 3.0/FPC 3.2.2

 

TinyPortal © 2005-2018