Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

控件的AttachAllEvents 捕获不到kEventSystemKey ,比如捕获不到 ALT按键动作 #110

Open
cloud14k opened this issue Apr 25, 2024 · 1 comment

Comments

@cloud14k
Copy link

我在一个label中使用lb_show_hide_board_= (ui::Label*)FindControl(L"show_hide_board");
lb_show_hide_board_->AttachAllEvents(nbase::Bind(&KbShutcutsForm::OnLbShowHideBoardNotify, this, std::placeholders::_1));
bool KbShutcutsForm::OnLbShowHideBoardNotify(ui::EventArgs* msg)
{
if (msg->Type == kEventSystemKey) {
ui::EventArgs* m = msg;
}
}
按alt进入不到这个kEventSystemKey 过程,请帮忙解答一下,不胜感激。

@nmgwddj
Copy link
Collaborator

nmgwddj commented Apr 25, 2024

All events 事件在统一的 Control 基类中处理,这部分代码也是完全开放的,可尝试在派发 AllEvent 事件位置下断点排查系统回调上来的消息,参考这里代码:https://github.com/netease-kit/NIM_PC_Demo/blob/master/tool_kits/duilib/Core/Control.cpp#L740-L742

另外除了基于源码调试外,我个人一些历史经验可以参考:

  • 该控件事件是否可能被其他上层控件捕获
  • 该控件事件是否可能被外层其他控件捕获

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants