Second mouse button input

Member
Posts: 164
Joined: 2002.04
Post: #1
Is this possible in Carbon? Do you know how to do this?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
You can do it with Carbon Events.
Quote this message in a reply
rvangaal
Unregistered
 
Post: #3
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);
}
}
}
Quote this message in a reply
Member
Posts: 164
Joined: 2002.04
Post: #4
Neat, thanks Smile

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.
Quote this message in a reply
Member
Posts: 351
Joined: 2002.04
Post: #5
Probably best to get into Carbon Events anyway, I'm starting to like 'em quite a lot.
Quote this message in a reply
rvangaal
Unregistered
 
Post: #6
Are the EventRecords from the Classis system?
I know my first events on the Mac did only the 1st mouse button, and Carbon events were indeed needed.
Gives you a mouse wheel as well...
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Help with Locating Mouse Input within a Square blobbo 4 2,760 Oct 13, 2009 07:55 PM
Last Post: blobbo
  Left mouse button causes moueup event despite button still being pressed. QuestingCordiial 28 11,338 Jun 21, 2008 03:18 PM
Last Post: AnotherJake
  Mouse button enabler, like GamePad Companion setera 4 4,362 Apr 30, 2006 06:32 PM
Last Post: setera
  Problem reading mouse button state Bossa Nova 3 3,071 Jul 23, 2003 12:09 PM
Last Post: Iceman