Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一个 NSButton 在 mouseup 上引发单击事件,即使已在按钮外部按下鼠标。你有什么想法得到这种行为吗?
谢谢!
在释放按钮之前将鼠标移出控件允许用户取消操作。
我认为这样做的唯一方法是拦截所有事件并自己处理所有点击跟踪和移动跟踪。
但是,这会导致非常意外的界面行为,因此您应该仔细考虑为什么需要这样做。