[haiku-appserver] Re: [Haiku-commits] r12082 - haiku/trunk/src/kits/interface

  • From: Adi Oanca <adioanca@xxxxxxxxxxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Tue, 29 Mar 2005 15:33:50 +0300

Hi Michael,

Michael Lotz wrote:
>  > For B_KEY_DOWN, BWindow will first handle this message in
>  > DispatchMessage to intercept TAB, SHIFT+TAB, OPTION+TAB, etc keystrokes
>  > to that it would advance to the next focus item/group. It is after that
>  > check that it calls fFocus->KeyDown(); Same goes for the menu and
>  > DefaultButton.

[...]

> You have your BWindow which has a BView attached where you track B_KEY_DOWNs 
> with the 
> KeyDown hook function. This works well for almost all cases. But if you want 
> to write a 
> Terminal application, you will need to get those B_TAB keys too.

[...]

> I hope this clears it up a bit.

        Yup. Now I know exactly what you want.

        If you read all this thread it means you know about Stephan's comment 
related to TAB
key ( that focus would not change if you don't call BView::KeyDown(), or at 
least that's
what I understood - have to test it, but I'm pretty sure he's right). I will 
change
BWindow/BView so that views can get B_TAB messages and react to them.

        Now, IF Stephan is wrong (I doubt) I will still remove the code you 
added as it's
not the right way to do things. Instead of modifying task_looper() the way you 
did, you
should've implemented a message filter looking for B_KEY_DOWN with B_TAB in it, 
and put
as the destination handler PreferredHandler(), which in case of BWindow is 
exactly the
BView in focus. (If this does not work then we have a bug :-))


        I understand your need to make things work, but please, let's rush 
things and do
them in "The Right Way(TM)". :-)


Thanks,
Adi.

Other related posts: