> compile NEMU
221220000 张三 Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux 20:58:11 up 7 days, 20:58, 1 user, load average: 0.80, 0.53, 0.40
This commit is contained in:
@ -20,7 +20,7 @@ int SDL_PollEvent(SDL_Event *ev) {
|
|||||||
int SDL_WaitEvent(SDL_Event *event) {
|
int SDL_WaitEvent(SDL_Event *event) {
|
||||||
char buf[64];
|
char buf[64];
|
||||||
while (NDL_PollEvent(buf, sizeof(buf)) == 0);
|
while (NDL_PollEvent(buf, sizeof(buf)) == 0);
|
||||||
printf("key %s\n", buf);
|
printf("SDL_WaitEvent Recv %s\n", buf);
|
||||||
if (buf[0] == 'k') {
|
if (buf[0] == 'k') {
|
||||||
if (buf[1] == 'd') {
|
if (buf[1] == 'd') {
|
||||||
event->type = SDL_KEYDOWN;
|
event->type = SDL_KEYDOWN;
|
||||||
@ -29,6 +29,7 @@ int SDL_WaitEvent(SDL_Event *event) {
|
|||||||
}
|
}
|
||||||
for (int i = 0; i < sizeof(keyname) / sizeof(keyname[0]); i ++ ) {
|
for (int i = 0; i < sizeof(keyname) / sizeof(keyname[0]); i ++ ) {
|
||||||
if (strcmp(buf + 3, keyname[i]) == 0) {
|
if (strcmp(buf + 3, keyname[i]) == 0) {
|
||||||
|
printf("SDL_WaitEvent Got %s\n", keyname[i]);
|
||||||
event->key.keysym.sym = i;
|
event->key.keysym.sym = i;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user