Le 08/06/2006, Ilkka Lehtoranta a écrit:
>> The first step is made but why the other keys (space, back space) have
>> not the same effect than in YAM ?
> Did you try using higher priority for your handler?
That doesn't change nothing. But, I found how to do what I want !
With the AddEventHandler, I had "up, down, page up and page down" that
worked. Then, I write a child function of MUIM_HandleEvent catching vanilla
keys (space, back space, enter and escape) and I call the some appropriate
methods (I've just re-discovered MUIM_TextEditor_ARexxCmd !!) :
static ULONG DocViewHandleEvent(struct IClass *cl, Object *obj, Msg *msg)
{
struct IntuiMessage *imsg;
if((imsg = ((struct MUIP_HandleEvent *)msg)->imsg))
{
if (imsg->Class == IDCMP_VANILLAKEY){
switch(imsg->Code){
case 27:
DoMethod(_app(obj), MUIM_Application_ReturnID,
MUIV_Application_ReturnID_Quit);
break;
case 32:
DoMethod(obj, MUIM_TextEditor_ARexxCmd, "NEXT Page");
break;
case 8:
DoMethod(obj, MUIM_TextEditor_ARexxCmd, "PREVIOUS
Page");
break;
case 13:
DoMethod(obj, MUIM_TextEditor_ARexxCmd, "CURSOR Down");
break;
}
}
}
return DoSuperMethodA(cl, obj, msg);
}
I don't know exactly if I have to return MUI_EventHandlerRC_Eat in my
special cases ...
That seems to work but with MUIM_HandleInput that share the same prototype
and treat Intuition messages too, with MUIA_Window_InputEvent, ... I don't
know where I am. Are some functions deprecated ?
Thanks to you (once again), Ilkka and Christian !
--
Mathias PARNAUDEAU
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get to your groups with one click. Know instantly when new email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/16uqlB/TM
--------------------------------------------------------------------~->
Visit http://www.amiga.dk/tumult for MUI-related
information, especially about MUI custom classes.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MUI/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/