OS X:获取按钮的鼠标按钮位置比三个标准按钮更大



是否有一种简单的方法来找出是否单击多按钮鼠标上的按钮(有三个按钮)?

例如。五个按钮鼠标上的第五个按钮。

我知道这是可能的,因为诸如USB Overdrive和Smart Scroll之类的应用...

是的,只需要求活动的buttonNumber

- (void)mouseDown:(NSEvent *)theEvent
{
    if(theEvent.type == NSOtherMouseDown)
    {
        NSLog(@"Button number %ld was pressed.", theEvent.buttonNumber);
    }
}

最新更新