wxWidgets 是什么意思? EVT_CHAR_HOOK做什么?
我正在维护一个 wxWidgets C++ 应用程序,它使用 EVT_CHAR_HOOK 来捕获高级窗口中的关键事件。我找不到此事件的任何真实文档,但我可以推测它以某种优先于“标准”关键事件的方式拦截关键事件。我刚刚发现的一件令人不安的事情是,如果这个挂钩到位,任何可能已定义的加速键将不再触发其事件,即使事件处理程序在事件上调用 Skip() 也是如此。我在谷歌搜索时也看到了一些帖子,似乎表明并非所有平台都支持 EVT_CHAR_HOOK。这是真的吗?我应该使用它吗?
I am maintaining a wxWidgets C++ application that uses EVT_CHAR_HOOK to capture key events in a high level window. I can't find any real documentation for this event but I can surmise that it intercepts key events in some way that has priority over the "standard" key events. One disturbing thing that I just discovered is that, if this hook is in place, any accelerator keys that might have been defined will no longer fire their events even if the event handler calls Skip() on the event. I've also seen some posts when searching on google that seemed to suggest that EVT_CHAR_HOOK may not be supported on all platforms. Is this true and should I be using it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚查看了
src/gtk/window.cpp
并找到了这篇文章:所以,也许您只需要从
OnCharHook
事件中返回false
处理程序?根据 wx 邮件列表帖子之一:
但另一篇文章指出:
此帖子可能是您感兴趣。
I just looked into
src/gtk/window.cpp
and found this piece:So, maybe you just need to return
false
from yourOnCharHook
event handler?In accordance to one of wx Mailing list post:
But another post states:
This post may be of interest to you.