CGWheelCount wheelCount = 2; // 1 for Y-only,2 for Y-X,3 for Y-X-Zint32_t xScroll = −1; // Negative for rightint32_t yScroll = −2; // Negative for downCGEventRef cgEvent = CGEventCreateScrollWheelEvent(NulL,kCGScrollEventUnitline,wheelCount,yScroll,xScroll);// You can post the CGEvent to the event stream to have it automatically sent to the window under the cursorCGEventPost(kCGHIDEventTap,cgEvent);NSEvent *theEvent = [NSEvent eventWithCGEvent:cgEvent];CFRelease(cgEvent);// Or you can send the NSEvent directly to a vIEw[theVIEw scrollWheel:theEvent];总结
以上是内存溢出为你收集整理的objective-c – 如何创建NSScrollWheel类型的NSEvent?全部内容,希望文章能够帮你解决objective-c – 如何创建NSScrollWheel类型的NSEvent?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)