Second mouse button input
Is this possible in Carbon? Do you know how to do this?
You can do it with Carbon Events.
Pseudo-code (clips):
static int ParseCarbonEvent(EventRef e,QEvent *qe)
{
UInt32 _class,kind;
Point point;
int n;
// Basic info on event
_class=GetEventClass(e);
kind=GetEventKind(e);
switch(_class)
{
// Mouse
case kEventClassMouse:
EventMouseButton b;
if(kind==kEventMouseDown)
{
GetEventParameter(e,kEventParamMouseLocation,typeQDPoint,
NULL,sizeof(Point),NULL,&point);
GetEventParameter(e,kEventParamMouseButton,typeMouseButton,
NULL,sizeof(b),NULL,&b);
printf(" button %d\n",b);
}
}
}
static int ParseCarbonEvent(EventRef e,QEvent *qe)
{
UInt32 _class,kind;
Point point;
int n;
// Basic info on event
_class=GetEventClass(e);
kind=GetEventKind(e);
switch(_class)
{
// Mouse
case kEventClassMouse:
EventMouseButton b;
if(kind==kEventMouseDown)
{
GetEventParameter(e,kEventParamMouseLocation,typeQDPoint,
NULL,sizeof(Point),NULL,&point);
GetEventParameter(e,kEventParamMouseButton,typeMouseButton,
NULL,sizeof(b),NULL,&b);
printf(" button %d\n",b);
}
}
}
Neat, thanks 
It would be a lot easier if I could do it with EventRecords though, is that possible? Or do I have to redo everything to use carbon events.

It would be a lot easier if I could do it with EventRecords though, is that possible? Or do I have to redo everything to use carbon events.
Probably best to get into Carbon Events anyway, I'm starting to like 'em quite a lot.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Help with Locating Mouse Input within a Square | blobbo | 4 | 2,482 |
Oct 13, 2009 07:55 PM Last Post: blobbo |
|
| Left mouse button causes moueup event despite button still being pressed. | QuestingCordiial | 28 | 10,154 |
Jun 21, 2008 03:18 PM Last Post: AnotherJake |
|
| Mouse button enabler, like GamePad Companion | setera | 4 | 3,879 |
Apr 30, 2006 06:32 PM Last Post: setera |
|
| Problem reading mouse button state | Bossa Nova | 3 | 2,805 |
Jul 23, 2003 12:09 PM Last Post: Iceman |
|

