Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2007-05

Qt Key events

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

zeljko

What is needed to be implemented in Qt widgetset so eg. TEdit.OnKeyDown() get fired ?
Messages delivery ? As I can see SlotKey() is called ok, but cannot get anything in OnKeyDown(),OnKeyPress(),OnKeyUp() of any control ...

tnx

Reply by email

Felipe Monteiro de Carvalho
to zeljko
zeljko wrote
What is needed to be implemented in Qt widgetset so eg. TEdit.OnKeyDown() get fired ? Messages delivery ? As I can see SlotKey() is called ok, but cannot get anything in OnKeyDown(),OnKeyPress(),OnKeyUp() of any control ...

If SlotKey is called, then there is nothing qt specific about the problem. It's a question of knowing which lcl calls to make .... I'd advice to ask this on the main lazarus mailling list, so the LCL experts can see it.

thanks,

Felipe Monteiro de Carvalho

Reply by email

Mattias Gaertner
to Felipe Monteiro de Carvalho
Show quoted text 11 lines
On 5/22/07, zeljko wrote: > What is needed to be implemented in Qt widgetset so eg. > TEdit.OnKeyDown() get fired ? > Messages delivery ? As I can see SlotKey() is called ok, but cannot > get anything in OnKeyDown(),OnKeyPress(),OnKeyUp() of any > control ... If SlotKey is called, then there is nothing qt specific about the problem. It's a question of knowing which lcl calls to make .... I'd advice to ask this on the main lazarus mailling list, so the LCL experts can see it.

http://wiki.lazarus.freepascal.org/LCL_Key_Handling

Mattias

Reply by email

zeljko
to Mattias Gaertner
Mattias Gaertner wrote 16 lines
On Tue, 22 May 2007 21:47:43 +0200 "Felipe Monteiro de Carvalho" wrote: > On 5/22/07, zeljko wrote: > > What is needed to be implemented in Qt widgetset so eg. > > TEdit.OnKeyDown() get fired ? > > Messages delivery ? As I can see SlotKey() is called ok, but cannot > > get anything in OnKeyDown(),OnKeyPress(),OnKeyUp() of any > > control ... > > If SlotKey is called, then there is nothing qt specific about the > problem. It's a question of knowing which lcl calls to make .... I'd > advice to ask this on the main lazarus mailling list, so the LCL > experts can see it. http://wiki.lazarus.freepascal.org/LCL_Key_Handling

tnx, I've found that in TQtWidget.SlotKey(Event: QEventH); cdecl; is called LCLObject.WndProc(Msg) ?!? why ? I've just changed it with LCLObject.Broadcast(Msg) and now I can get OnKeyXXXX() events in controls (doubled, but I get it ;) ). Felipe ?

Reply by email

Felipe Monteiro de Carvalho
to zeljko
zeljko wrote
I've overriden EventFilter() for QtLineEdit, and now got proper KeyPress & KeyUp handling.

If it works, great =) send a patch when you are ready.

About SlotKey calling LCLObject.WndProc, well, I just thougth that sending this message would make it work, which obviously wasn't the case =)

I think I made that on the other components and it worked, so I stuck with the same code.

thanks,

Felipe Monteiro de Carvalho

Reply by email

zeljko
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 5 lines
On 5/26/07, zeljko wrote: > I've overriden EventFilter() for QtLineEdit, and now got proper KeyPress > & KeyUp handling. If it works, great =) send a patch when you are ready.

yes, it works but in different manner, patch will be created as soon as I better understand the way of LCL handling such events.

if I set LclObject.BroadCast(msg) then we get double fire over controls like QtLineEdit(), that means thet if OnKeyDown() is assigned we'll get twice same key.
Without implementation of EventFilter() per class it's impossible. Why this don't work in LCL ??
QtWidget have EventFilter() virtual; , I've just overriden it in TQtLineEdit, but it's never called, it always calls TQtWidget's EventFilter, but if I create a hook in TQtLineEdit constructor then it works. I'm not sure that I understand LCL perfectly so why overriden method isn't called ? anyone ?

About SlotKey calling LCLObject.WndProc, well, I just thougth that sending this message would make it work, which obviously wasn't the case =)

We must use DeliverMessage or Broadcast (I think so), but upper problem makes me a bit crazy :)

Show quoted text 5 lines
I think I made that on the other components and it worked, so I stuck with the same code. thanks,

cheers

Reply by email