mac开发
finger_chung
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
cocoa 判断修饰键被按下
添加NSEvent扩展 @interface NSEvent (Category) - (BOOL)isCommandDown; - (BOOL)isShiftDown; - (BOOL)isControlDown; - (BOOL)isOptionDown; @end @implementation NSEvent (Category) - (BOOL)isCommandDo...原创 2018-06-30 16:25:18 · 709 阅读 · 0 评论 -
cocoa 代码方式获取CPU核数
C代码 #include <sys/sysctl.h> unsigned cpuCount() { int mib[2] = { CTL_HW, HW_AVAILCPU }; unsigned cpuCount; size_t sizeOfCpuCount = sizeof(cpuCount); int status = sysctl(mib, 2,...原创 2018-07-02 21:42:51 · 742 阅读 · 0 评论 -
cocoa 鼠标位置
# 获取鼠标在屏幕位置NSEvent.mouseLocation# 获取鼠标在窗口位置self.window.mouseLocationOutsideOfEventStream原创 2018-06-28 17:56:59 · 747 阅读 · 0 评论
分享