Why my view can't get some Carbon Events?
Why my view can't get some Carbon Events?
- Subject: Why my view can't get some Carbon Events?
- From: Masanao Hayashi <email@hidden>
- Date: Mon, 3 Feb 2003 02:07:04 +0900
Hi lists,
I'm implementing my carbon view which inherited AUCarbonViewBase using
Project Builder and CoreAudio SDK.
And I'm using Rax 0.3.2b to testing my AU.
(Thank you very much for Granted SW!!!)
I perform to install ALL window events/mouse events as kEventMouse***
and
kEventWindow**** by calling CarbonEventHandler::WantEventTypes() in my
CreateCarbonView() function. And all events return false in my
HandleEvent() because
I want to do nothing and perform default behavior now.
//-------------------------
EventTypeSpec CHfcAUEditor::sm_aWindowEventType[] = {
{ kEventClassWindow, kEventWindowUpdate},
{ kEventClassWindow, kEventWindowDrawContent},
{ kEventClassWindow, kEventWindowPaint},
// snip
{ kEventClassMouse, kEventMouseDown},
{ kEventClassMouse, kEventMouseUp},
{ kEventClassMouse, kEventMouseMoved},
{ kEventClassMouse, kEventMouseDragged},
{ kEventClassMouse, kEventMouseWheelMoved}
};
ComponentResult CHfcAUEditor::CreateCarbonView(AudioUnit inAudioUnit,
WindowRef inWindow, ControlRef inParentControl, const Float32Point
&inLocation, const Float32Point &inSize, ControlRef &outParentControl)
{
ComponentResult iRet = noErr;
iRet = AUCarbonViewBase::CreateCarbonView(inAudioUnit, inWindow,
inParentControl, inLocation, inSize, outParentControl);
WantEventTypes(GetWindowEventTarget(inWindow),
GetEventTypeCount(sm_aWindowEventType), sm_aWindowEventType);
return iRet;
}
bool CHfcAUEditor::HandleEvent(EventRef event)
{
bool bRet = AUCarbonViewBase::HandleEvent(event);
UInt32 iEventClass = ::GetEventClass(event);
UInt32 iEventKind = ::GetEventKind(event);
// Mouse Events
if (iEventClass == kEventClassMouse) {
switch (iEventKind) {
case kEventMouseDown:
::DebugStr("\pkEventMouseDown");
break;
// snip
}
}
else if (iEventClass == kEventClassWindow) {
switch (iEventKind) {
case kEventWindowUpdate:
::DebugStr("\pkEventWindowUpdate");
break;
// snip
}
}
return bRet;
}
//-------------------------
Then I can get some carbon events such as kEventMouseUp,
kEventWindowActivated,
kEventWindowDispose, kEventWindowClose, kEventWindowShowing,
kEventWindowShown, etc.
But I can NOT get some events kEventWindowHidden, kEventWindowHiding,
etc.
Specially, once I get the event kEventMouseDown, never sent any more...
(why only once??? )
Please advice me, anyone!!!
--------------------------------
Masanao Hayashi
email@hidden
http://www40.tok2.com/home/ring2/
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.