Trying to capture raw touch events on the trackpad

  • Hi all,

    I'm trying to capture raw touch events on the trackpad to define my own
    gesture events. I've gone through the documentation here:
    http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/Even
    tOverview/HandlingTouchEvents/HandlingTouchEvents.html


    I've set [mView setAcceptsTouchEvents:YES] and implemented the following
    functions:

    - (void)touchesBeganWithEvent:(NSEvent *)event;

    - (void)touchesMovedWithEvent:(NSEvent *)event;

    - (void)touchesEndedWithEvent:(NSEvent *)event;

    - (void)touchesCancelledWithEvent:(NSEvent *)event;

    but *I'm just not getting any calls in any of the above functions*. I keep
    getting calls in mouseMoved, mouseEntered, but not any touch messages.

    Am I missing something?

    Kindly help.

    Regards,
    Akhil Jindal
  • is mView an iboutlet member?
    and where [mView setAcceptsTouchEvents:YES] get called? awakeFromNib or init?

    Best Regards,
    Zongyao QU

    2012/7/27 Akhil Jindal <akhil89...>:
    > Hi all,
    >
    > I'm trying to capture raw touch events on the trackpad to define my own
    > gesture events. I've gone through the documentation here:
    > http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/Even
    tOverview/HandlingTouchEvents/HandlingTouchEvents.html

    >
    > I've set [mView setAcceptsTouchEvents:YES] and implemented the following
    > functions:
    >
    >
    > - (void)touchesBeganWithEvent:(NSEvent *)event;
    >
    > - (void)touchesMovedWithEvent:(NSEvent *)event;
    >
    >
    > - (void)touchesEndedWithEvent:(NSEvent *)event;
    >
    > - (void)touchesCancelledWithEvent:(NSEvent *)event;
    >
    >
    > but *I'm just not getting any calls in any of the above functions*. I keep
    > getting calls in mouseMoved, mouseEntered, but not any touch messages.
    >
    > Am I missing something?
    >
    > Kindly help.
    >
    > Regards,
    > Akhil Jindal
  • mouseEntered???? do you also have a tracking area setup? When are you calling setAcceptsTouchEvent:? FYI, You won't get touch events unless the cursor is over your view when the first touch occurs. While dragging the cursor, the touch doing that was latched to some other view. All touches are latched to that other view until the user removes all touches and starts over.

    -raleigh

    On Jul 27, 2012, at 5:25 AM, Akhil Jindal <akhil89...> wrote:

    > Hi all,
    >
    > I'm trying to capture raw touch events on the trackpad to define my own
    > gesture events. I've gone through the documentation here:
    > http://developer.apple.com/library/mac/#documentation/cocoa/conceptual/Even
    tOverview/HandlingTouchEvents/HandlingTouchEvents.html

    >
    > I've set [mView setAcceptsTouchEvents:YES] and implemented the following
    > functions:
    >
    >
    > - (void)touchesBeganWithEvent:(NSEvent *)event;
    >
    > - (void)touchesMovedWithEvent:(NSEvent *)event;
    >
    >
    > - (void)touchesEndedWithEvent:(NSEvent *)event;
    >
    > - (void)touchesCancelledWithEvent:(NSEvent *)event;
    >
    >
    > but *I'm just not getting any calls in any of the above functions*. I keep
    > getting calls in mouseMoved, mouseEntered, but not any touch messages.
    >
    > Am I missing something?
    >
    > Kindly help.
    >
    > Regards,
    > Akhil Jindal
previous month july 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today