所以我一直在试验 Gtkmm,因为我想将我的一些代码迁移到 C++,我认为它会更容易。
我曾经能够在 C 中使用看起来像这样的东西:
g_signal_connect(entry, "key-release-event", G_CALLBACK(receiveKeyPressed), NULL);
但似乎当我尝试在 Gtkmm 中使用类似的系统时:
entry->signal_key_pressed().connect( sigc::ptr_fun(*receiveKeyPressed) );
它完全错过了所有键盘按键,除了 shift 键和 tab 等。
谁能解释一下为什么?