List Info

Thread: Key Binding Rundown




Key Binding Rundown
country flaguser name
United States
2007-11-01 12:09:27
Peter Krenesky wrote:
> Sarah,
> 
> the important part that we covered is that to get
XEvents from the engine you 
> need to use the IHXSiteUser interface defined in
common/include/hxwin.h:581  
> 
> I did some more research on IHXSiteUser and heres what
i found out:
> 
> You will need to implement the methods defined by this
interface.  The most 
> important method being
IHXSiteUser::HandleEvent(HXxEvent*).  This method 
> should receive all keypresses.  
> 
> The Class PyClientContext
(player/kit/python/pycontxt.h) is the class that 
> should implement the interface.  It already implements
the other site 
> functionality including some of the methods described
by IHXSiteUser.
> 
> Once you have implemented the IHXSiteUser you can use 
> IHXSite::AttachUser(IHXSiteUser*)  to register for
events after the site is 
> created.

[I am adding video-dev list too because any change here
will
  be of interest to everyone who uses and works on the
site]

The problem here is that some renderers will attach as the
site
user as soon as the site is passed to them, and in the theme
of
a popular book/movie, 'there can be only one'. That is,
m_pUser
is not a list of users but instead only hold one:

STDMETHODIMP CHXBaseSite::AttachUser(IHXSiteUser* /*IN*/
pUser)
{
     if (m_pUser) return HXR_UNEXPECTED;


This is the same as the site watcher:

STDMETHODIMP CHXBaseSite::AttachWatcher(IHXSiteWatcher*
/*IN*/ pWatcher)
{
     if (m_pWatcher) return HXR_UNEXPECTED;


However, for watchers we need more then one, so we came up
with the notion of a list of 'passive' site watcher:


STDMETHODIMP
CHXBaseSite::AddPassiveSiteWatcher(IHXPassiveSiteWatcher*
pWatcher)
{
     pWatcher->AddRef();
     m_PassiveSiteWatchers.AddTail(pWatcher);
     return HXR_OK;
}

Then, when something happens that a 'watcher' wants to know
about we
do:

     //before we do anything, we give the SiteWatcher a
chance to
     //influence this operation.
     if (m_pWatcher)
     {
         hres = m_pWatcher->ChangingSize(m_size, size);
     }
...
...
         // iterate child site list
         for(i=m_PassiveSiteWatchers.Begin(); i!=
m_PassiveSiteWatchers.End(); ++i)
         {
             ((IHXPassiveSiteWatcher*)
*i)->SizeChanged(&m_size);
         }
...
...

What we need is the idea of a passive site user list. Then,
after
we call:

         m_pUser->HandleEvent(&event);

we can call the list of passive site users and let them do
what
they need with key strokes.

That is what I think off the top of my head anyway.


--greg.



> 
> -Peter
> 
> On Wednesday 31 October 2007 2:22:57 pm Sarah Cooley
wrote:
>> Greg,
>> I was talking to Brad today about this morning's
conference call and
>> we were discussing how to implement key bindings by
giving the engine
>> focus then just passing the unhanded events to the
highest level of
>> the player possible (to the best of my
understanding) and I was just
>> wondering if you could type out this morning's
explanation of that.
>>
>> In short I'm looking for a run down of this
morning's call.
>>
>> Thank you,
>> Sarah
>>
>> _______________________________________________
>> Olpc-player-dev mailing list
>> Olpc-player-devlists.helixcommunity.org
>> http://lists.helixcommunity.org/mailman/listinfo
/olpc-player-dev
> 
> 
> _______________________________________________
> Olpc-player-dev mailing list
> Olpc-player-devlists.helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo
/olpc-player-dev


_______________________________________________
Video-dev mailing list
Video-devhelixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/video
-dev

Key Binding Rundown
user name
2007-11-13 12:33:07
I was tracing keyboard events from the X calls as was
originally
suggested and found in video/sitelib/basesite.cpp

         switch((ULONG32)pEvent->event)
         {
            case HX_KEY_UP:
            case HX_KEY_DOWN:
 #if defined(_DEBUG) && 0
                _PrintKeyboardEventInfo(pEvent);
 #endif
                // Always send <CR> and <TAB> to
the top level site for smil
 #if !defined(_MACINTOSH) && !defined(_MAC_UNIX) //
XXXSEH: Is this
the correct solution?
                if (HX_VK_TAB == (int)pEvent->param1 ||
HX_VK_RETURN
== (int)pEvent->param1)
 #else
                    if (0)
 #endif
                       
m_pTopLevelSite->m_pUser->HandleEvent(pEvent);
                // Send keyboard messages to the user that
has focus
                    else if
(m_pTopLevelSite->m_pKeyBoardFocusUser)

m_pTopLevelSite->m_pKeyBoardFocusUser->HandleEvent(pEv
ent);
                    else if (m_pUser)
                        m_pUser->HandleEvent(pEvent);

Is there some way we could use KeyBoardFocusUser to
implement key
bindings rather than making a passive site user?

~Sarah

On 11/1/07, Greg Wright <gwrightreal.com> wrote:
> Peter Krenesky wrote:
> > Sarah,
> >
> > the important part that we covered is that to get
XEvents from the engine you
> > need to use the IHXSiteUser interface defined in
common/include/hxwin.h:581
> >
> > I did some more research on IHXSiteUser and heres
what i found out:
> >
> > You will need to implement the methods defined by
this interface.  The most
> > important method being
IHXSiteUser::HandleEvent(HXxEvent*).  This method
> > should receive all keypresses.
> >
> > The Class PyClientContext
(player/kit/python/pycontxt.h) is the class that
> > should implement the interface.  It already
implements the other site
> > functionality including some of the methods
described by IHXSiteUser.
> >
> > Once you have implemented the IHXSiteUser you can
use
> > IHXSite::AttachUser(IHXSiteUser*)  to register for
events after the site is
> > created.
>
> [I am adding video-dev list too because any change here
will
>   be of interest to everyone who uses and works on the
site]
>
> The problem here is that some renderers will attach as
the site
> user as soon as the site is passed to them, and in the
theme of
> a popular book/movie, 'there can be only one'. That is,
m_pUser
> is not a list of users but instead only hold one:
>
> STDMETHODIMP CHXBaseSite::AttachUser(IHXSiteUser*
/*IN*/ pUser)
> {
>      if (m_pUser) return HXR_UNEXPECTED;
>
>
> This is the same as the site watcher:
>
> STDMETHODIMP CHXBaseSite::AttachWatcher(IHXSiteWatcher*
/*IN*/ pWatcher)
> {
>      if (m_pWatcher) return HXR_UNEXPECTED;
>
>
> However, for watchers we need more then one, so we came
up
> with the notion of a list of 'passive' site watcher:
>
>
> STDMETHODIMP
CHXBaseSite::AddPassiveSiteWatcher(IHXPassiveSiteWatcher*
pWatcher)
> {
>      pWatcher->AddRef();
>      m_PassiveSiteWatchers.AddTail(pWatcher);
>      return HXR_OK;
> }
>
> Then, when something happens that a 'watcher' wants to
know about we
> do:
>
>      //before we do anything, we give the SiteWatcher a
chance to
>      //influence this operation.
>      if (m_pWatcher)
>      {
>          hres = m_pWatcher->ChangingSize(m_size,
size);
>      }
> ...
> ...
>          // iterate child site list
>          for(i=m_PassiveSiteWatchers.Begin(); i!=
m_PassiveSiteWatchers.End(); ++i)
>          {
>              ((IHXPassiveSiteWatcher*)
*i)->SizeChanged(&m_size);
>          }
> ...
> ...
>
> What we need is the idea of a passive site user list.
Then, after
> we call:
>
>          m_pUser->HandleEvent(&event);
>
> we can call the list of passive site users and let them
do what
> they need with key strokes.
>
> That is what I think off the top of my head anyway.
>
>
> --greg.
>
>
>
> >
> > -Peter
> >
> > On Wednesday 31 October 2007 2:22:57 pm Sarah
Cooley wrote:
> >> Greg,
> >> I was talking to Brad today about this
morning's conference call and
> >> we were discussing how to implement key
bindings by giving the engine
> >> focus then just passing the unhanded events to
the highest level of
> >> the player possible (to the best of my
understanding) and I was just
> >> wondering if you could type out this morning's
explanation of that.
> >>
> >> In short I'm looking for a run down of this
morning's call.
> >>
> >> Thank you,
> >> Sarah
> >>
> >>
_______________________________________________
> >> Olpc-player-dev mailing list
> >> Olpc-player-devlists.helixcommunity.org
> >> http://lists.helixcommunity.org/mailman/listinfo
/olpc-player-dev
> >
> >
> > _______________________________________________
> > Olpc-player-dev mailing list
> > Olpc-player-devlists.helixcommunity.org
> > http://lists.helixcommunity.org/mailman/listinfo
/olpc-player-dev
>
>
> _______________________________________________
> Olpc-player-dev mailing list
> Olpc-player-devlists.helixcommunity.org
> http://lists.helixcommunity.org/mailman/listinfo
/olpc-player-dev
>

_______________________________________________
Video-dev mailing list
Video-devhelixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/video
-dev

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )