gpt4 book ai didi

objective-c - 在 NSWindows 中双击?

转载 作者:行者123 更新时间:2023-12-03 17:30:25 24 4
gpt4 key购买 nike

NSWindows 有多种函数来处理鼠标事件(即 void mouseDown 用于左键单击,void mouseDragged 用于拖动等)。使用什么函数来处理双击?

最佳答案

NSWindowNSResponder 的子类并继承其方法。
每个事件处理方法 -(void)mouseDown:(NSEvent *)theEvent; 就是其中之一,带有一个参数; 事件对象

要了解已记录的点击次数,请查询事件对象。

来自NSEvent文档,这里是返回此类信息的方法:

-(NSInteger)clickCount;

Returns the number of mouse clicks associated with the receiver, which represents a mouse-down or mouse-up event.

关于objective-c - 在 NSWindows 中双击?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9120560/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com