简体   繁体   English

NSButton在mouseup上引发click事件

[英]NSButton raising click event on mouseup

I am looking for an NSButton raising the click event on mouseup, even if the mouse down has been made outside the button. 我正在寻找一个NSButton引发mouseup上的click事件,即使将鼠标按下已在按钮外部也是如此。 Do you have any idea to get this behavior? 您是否有这种行为的想法?

Thanks! 谢谢!

Moving the mouse outside a control before releasing the button allows the user to cancel the action. 在释放按钮之前将鼠标移到控件外,允许用户取消操作。

I would think the only way to do that would be to intercept all events and handle all click tracking and movement tracking yourself. 我认为唯一的方法就是拦截所有事件并自己处理所有点击跟踪和移动跟踪。

However, it would result in a very unexpected interface behavior, so you should consider carefully why you need to do that. 但是,这将导致非常意外的界面行为,因此您应仔细考虑为什么需要这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM