#include<iostream>
#include<easyx.h>
int main()
{
initgraph(300, 300);
ExMessage msg;
while (1) {
if (peekmessage(&msg, EX_KEY))
std::cout << "gotted\n";
}
}
msg捕获到WM_MOUSEMOVE事件(调试可得),但是EX_KEY不应该捕获这类消息啊
二次编辑:更加神奇的是,将peekmessage改成getmessage并微调后,就能够获得对应的信息了
#include<iostream>
#include<easyx.h>
int main()
{
initgraph(300, 300);
ExMessage msg;
while (1) {
getmessage(&msg, EX_KEY);
std::cout << "gotted\n";
}
}