- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
0 && cgsEvent.type <= kCGSLastEventType"-6ren"> 0 && cgsEvent.type <= kCGSLastEventType"-有时,主要是在重负载时,我会收到以下错误: 2013-04-23 23:53:13.595 MusicPlayer[74705:6303] unrecognized type is -2 2013-0-6ren">
有时,主要是在重负载时,我会收到以下错误:
2013-04-23 23:53:13.595 MusicPlayer[74705:6303] unrecognized type is -2
2013-04-23 23:53:14.686 MusicPlayer[74705:6303] *** Assertion failure in -[NSEvent _initWithCGSEvent:eventRef:], /SourceCache/AppKit/AppKit-1187.37/AppKit.subproj/NSEvent.m:1348
2013-04-24 00:40:47.358 MusicPlayer[74705:6303] unrecognized type is -2
2013-04-24 00:40:47.561 MusicPlayer[74705:6303] *** Assertion failure in -[NSEvent _initWithCGSEvent:eventRef:], /SourceCache/AppKit/AppKit-1187.37/AppKit.subproj/NSEvent.m:1348
2013-04-24 00:42:49.016 MusicPlayer[74705:6303] unrecognized type is -2
2013-04-24 00:42:49.017 MusicPlayer[74705:6303] *** Assertion failure in -[NSEvent _initWithCGSEvent:eventRef:], /SourceCache/AppKit/AppKit-1187.37/AppKit.subproj/NSEvent.m:1348
2013-04-24 00:42:53.689 MusicPlayer[74705:6303] unrecognized type is -2
2013-04-24 00:42:53.689 MusicPlayer[74705:6303] *** Assertion failure in -[NSEvent _initWithCGSEvent:eventRef:], /SourceCache/AppKit/AppKit-1187.37/AppKit.subproj/NSEvent.m:1348
2013-04-24 00:43:01.091 MusicPlayer[74705:6303] unrecognized type is -2
2013-04-24 00:43:01.091 MusicPlayer[74705:6303] *** Assertion failure in -[NSEvent _initWithCGSEvent:eventRef:], /SourceCache/AppKit/AppKit-1187.37/AppKit.subproj/NSEvent.m:1348
2013-04-24 00:43:06.840 MusicPlayer[74705:6303] unrecognized type is -2
2013-04-24 00:43:06.840 MusicPlayer[74705:6303] *** Assertion failure in -[NSEvent _initWithCGSEvent:eventRef:], /SourceCache/AppKit/AppKit-1187.37/AppKit.subproj/NSEvent.m:1348
EXCEPTION
Traceback (most recent call last):
File "/Users/az/Programmierung/music-player/mac/build/Release/MusicPlayer.app/Contents/Resources/Python/mediakeys.py", line 71, in runEventsCapture
line: Quartz.CFRunLoopRun()
locals:
Quartz = <local> <module 'Quartz' from '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/Quartz/__init__.py'>
Quartz.CFRunLoopRun = <local> <objc.function 'CFRunLoopRun' at 0x1027dfb30>
error: NSInternalInconsistencyException - Invalid parameter not satisfying: cgsEvent.type > 0 && cgsEvent.type <= kCGSLastEventType
EXCEPTION
Traceback (most recent call last):
File "/Users/az/Programmierung/music-player/mac/build/Release/MusicPlayer.app/Contents/Resources/Python/mediakeys.py", line 71, in runEventsCapture
line: Quartz.CFRunLoopRun()
locals:
Quartz = <local> <module 'Quartz' from '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/Quartz/__init__.py'>
Quartz.CFRunLoopRun = <local> <objc.function 'CFRunLoopRun' at 0x1027dfb30>
error: NSInternalInconsistencyException - Invalid parameter not satisfying: cgsEvent.type > 0 && cgsEvent.type <= kCGSLastEventType
EXCEPTION
Traceback (most recent call last):
File "/Users/az/Programmierung/music-player/mac/build/Release/MusicPlayer.app/Contents/Resources/Python/mediakeys.py", line 71, in runEventsCapture
line: Quartz.CFRunLoopRun()
locals:
Quartz = <local> <module 'Quartz' from '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/Quartz/__init__.py'>
Quartz.CFRunLoopRun = <local> <objc.function 'CFRunLoopRun' at 0x1027dfb30>
error: NSInternalInconsistencyException - Invalid parameter not satisfying: cgsEvent.type > 0 && cgsEvent.type <= kCGSLastEventType
new song: Tiestö - Reepublic, 00:15, mp3, 125 kbit/s, 233 KB
EXCEPTION
Traceback (most recent call last):
File "/Users/az/Programmierung/music-player/mac/build/Release/MusicPlayer.app/Contents/Resources/Python/mediakeys.py", line 71, in runEventsCapture
line: Quartz.CFRunLoopRun()
locals:
Quartz = <local> <module 'Quartz' from '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/Quartz/__init__.py'>
Quartz.CFRunLoopRun = <local> <objc.function 'CFRunLoopRun' at 0x1027dfb30>
error: NSInternalInconsistencyException - Invalid parameter not satisfying: cgsEvent.type > 0 && cgsEvent.type <= kCGSLastEventType
EXCEPTION
Traceback (most recent call last):
File "/Users/az/Programmierung/music-player/mac/build/Release/MusicPlayer.app/Contents/Resources/Python/mediakeys.py", line 71, in runEventsCapture
line: Quartz.CFRunLoopRun()
locals:
Quartz = <local> <module 'Quartz' from '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/Quartz/__init__.py'>
Quartz.CFRunLoopRun = <local> <objc.function 'CFRunLoopRun' at 0x1027dfb30>
error: NSInternalInconsistencyException - Invalid parameter not satisfying: cgsEvent.type > 0 && cgsEvent.type <= kCGSLastEventType
EXCEPTION
Traceback (most recent call last):
File "/Users/az/Programmierung/music-player/mac/build/Release/MusicPlayer.app/Contents/Resources/Python/mediakeys.py", line 71, in runEventsCapture
line: Quartz.CFRunLoopRun()
locals:
Quartz = <local> <module 'Quartz' from '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC/Quartz/__init__.py'>
Quartz.CFRunLoopRun = <local> <objc.function 'CFRunLoopRun' at 0x1027dfb30>
error: NSInternalInconsistencyException - Invalid parameter not satisfying: cgsEvent.type > 0 && cgsEvent.type <= kCGSLastEventType
相关代码:
import AppKit, Quartz
from AppKit import NSSystemDefined
pool = AppKit.NSAutoreleasePool.alloc().init()
self.runLoopRef = Quartz.CFRunLoopGetCurrent()
while True:
# https://developer.apple.com/library/mac/#documentation/Carbon/Reference/QuartzEventServicesRef/Reference/reference.html
tap = Quartz.CGEventTapCreate(
Quartz.kCGSessionEventTap, # Quartz.kCGSessionEventTap or kCGHIDEventTap
Quartz.kCGHeadInsertEventTap, # Insert wherever, we do not filter
Quartz.kCGEventTapOptionDefault, #Quartz.kCGEventTapOptionListenOnly,
Quartz.CGEventMaskBit(NSSystemDefined), # NSSystemDefined for media keys
self.eventTap,
None
)
assert tap
# Create a runloop source and add it to the current loop
runLoopSource = Quartz.CFMachPortCreateRunLoopSource(None, tap, 0)
Quartz.CFRunLoopAddSource(
self.runLoopRef,
runLoopSource,
Quartz.kCFRunLoopDefaultMode
)
# Enable the tap
Quartz.CGEventTapEnable(tap, True)
try:
# and run! This won't return until we exit or are terminated.
Quartz.CFRunLoopRun()
except Exception:
# I got this one here once:
# error: NSInternalInconsistencyException - Invalid parameter not satisfying: cgsEvent.type > 0 && cgsEvent.type <= kCGSLastEventType
sys.excepthook(*sys.exc_info())
continue # rerun
# this is a regular quit
break
del pool
该异常主要伴随着 GUI 线程的挂起(这是我不想忽略它的主要原因 - 因为它可能非常值得注意)。
最佳答案
来自here ,我得到了有用的信息:
Actually an event type CGEventType is defined in CGEventType.h as unsigned 32-bit integer. So your -2 is actually 0xFFFFFFFE. In CGEventType.h that's defined as kCGEventTapDisabledByTimeout. There's a comment just about this that says:
/* Out of band event types. These are delivered to the event tap callback
to notify it of unusual conditions that disable the event tap. */
kCGEventTapDisabledByTimeout = 0xFFFFFFFE,
kCGEventTapDisabledByUserInput = 0xFFFFFFFFSo it looks like your event tap is timing out. That's why your not getting anymore events after this.
在 Python 中,在事件点击中,您可以像这样检查这种情况:
def eventTap(self, proxy, type_, event, refcon):
if type_ < 0 or type_ > 0x7fffffff:
# handle it ...
请注意,在获得此类事件类型后,事件点击将被禁用。因此您可能想重新启动事件循环。
关于python - "error: NSInternalInconsistencyException - Invalid parameter not satisfying: cgsEvent.type > 0 && cgsEvent.type <= kCGSLastEventType",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16190680/
我写了一个我认为是 quite interesting question 的答案,但不幸的是,在我发布之前,该问题已被作者删除。我在这里重新发布问题的摘要和我的答案,以防其他人有用。 假设我有一个 S
有没有办法写约束: C t1 t2 :: Constraint 如果 t2 与 t1 匹配,它“满足”(这是正确的词)。 例如: C (forall a. Num a => a -> a -> a)
我正在尝试用这段代码求解方程: a = [-0.0008333 -0.025 -0.6667 -20]; length_OnePart = 7.3248; xi = -6.4446; yi = -16
我知道我可以关闭 MySQL 中的安全模式,所以我不会尝试解决这个问题。 我有一个简单的表格: create table rubbish( id int auto_increment prim
尝试刷新我的 sencha extjs 应用程序并总是收到此错误: 命令: sencha 应用程序刷新 sencha 应用升级 总是同样的错误: [ERR] Cannot satisfy requir
我正在尝试为我的项目创建一个测试套件,HaskSplit在我的 .cabal 配置中: -- Initial HaskSplit.cabal generated by cabal init. For
我有 pc/sc 读卡器和非接触式卡(mifare 卡),我可以连接到该卡,并且我也成功执行 getdate 命令,但是当我想进行身份验证时,我看到此错误“6982:安全状态不满足”我已经尝试了这 3
简而言之,流程如下: inputChannel->transformer->firstOutboundAdapter->pollingOutboundAdapter 概要:inputChannel 接
这个问题在这里已经有了答案: Why do try!() and ? not compile when used in a function that doesn't return Option o
我正在尝试切片矢量并在 Rust 中同时打印它。这是我的代码: fn main() { let a = vec![1, 2, 3, 4]; println!("{:?}", a[1..
我正在尝试自定义约束 菜单栏类: import UIKit class ManuBar: UIView { override init(frame: CGRect) { sup
我遇到了这个问题,我有一个聊天服务器需要与托管在 aws 中的 lambda 服务进行通信,但云前端会引发以下错误。 BODY: ERROR: The request could not be s
我有一个包含Arc>的结构,我试图添加一个获取self所有权的方法,并将所有权移到新线程中并启动它。但是,我得到了错误 error[E0277]: the trait bound `std::sync
我遇到了一个编译错误,似乎突出显示了我对类型系统不了解的内容。 我想将字符串转换为整数,如果字符串不是有效整数,则带有自定义 panic 消息。我做一个match在 Result由 parse() 返
这是应用过滤器后复制数据的代码。 Sub read_excel_file(path_to_current_work_book As String, path_to_destination_work
我们有一个 shell 脚本,可以自动准备虚拟环境,然后在其中运行测试。部分脚本安装要求: pip install -r requirements.txt 当脚本多次运行时,它会针对每个要求打印一条警
总是遇到 FoodTracker 教程;遵循此步骤:“实现自定义控件” https://developer.apple.com/library/content/referencelibrary/Get
我收到此错误: Unable to simultaneously satisfy constraints. Probably at least one of the constraints in th
我有一个 UITableViewCell我正在创建,并且我正在使用带有完全在代码中构建的约束的自动布局。 虽然应用程序中的实际输出很好(即,它看起来就像我设计的那样),但我收到了著名的“无法同时满足约
这个问题在这里已经有了答案: Disable autolayout constraint error messages in debug console output in Xcode (5 个回答)
我是一名优秀的程序员,十分优秀!