comparison src/events/SDL_keyboard.c @ 1731:875c3cf1a12c SDL-1.3

SDL_PushEvent() calls the event filter code, and has a return value to tell whether or not the event was actually pushed. SDL_GetEventFilter() now returns an SDL_bool instead of the filter function.
author Sam Lantinga <slouken@libsdl.org>
date Sat, 08 Jul 2006 20:07:08 +0000
parents 6c63fc2bd986
children fd65f12b6de6
comparison
equal deleted inserted replaced
1730:e70477157db9 1731:875c3cf1a12c
662 } 662 }
663 keyboard->repeat.evt = event; 663 keyboard->repeat.evt = event;
664 keyboard->repeat.firsttime = 1; 664 keyboard->repeat.firsttime = 1;
665 keyboard->repeat.timestamp = 1; 665 keyboard->repeat.timestamp = 1;
666 } 666 }
667 if ((SDL_EventOK == NULL) || SDL_EventOK(SDL_EventOKParam, &event)) { 667 posted = (SDL_PushEvent(&event) > 0);
668 posted = 1;
669 SDL_PushEvent(&event);
670 }
671 } 668 }
672 return (posted); 669 return (posted);
673 } 670 }
674 671
675 int 672 int
688 SDL_Event event; 685 SDL_Event event;
689 event.text.type = SDL_TEXTINPUT; 686 event.text.type = SDL_TEXTINPUT;
690 event.text.which = (Uint8) index; 687 event.text.which = (Uint8) index;
691 SDL_strlcpy(event.text.text, text, SDL_arraysize(event.text.text)); 688 SDL_strlcpy(event.text.text, text, SDL_arraysize(event.text.text));
692 event.key.windowID = keyboard->focus; 689 event.key.windowID = keyboard->focus;
693 if ((SDL_EventOK == NULL) || SDL_EventOK(SDL_EventOKParam, &event)) { 690 posted = (SDL_PushEvent(&event) > 0);
694 posted = 1;
695 SDL_PushEvent(&event);
696 }
697 } 691 }
698 return (posted); 692 return (posted);
699 } 693 }
700 694
701 /* 695 /*
724 keyboard->repeat.firsttime = 0; 718 keyboard->repeat.firsttime = 0;
725 } 719 }
726 } else { 720 } else {
727 if (interval > (Uint32) keyboard->repeat.interval) { 721 if (interval > (Uint32) keyboard->repeat.interval) {
728 keyboard->repeat.timestamp = now; 722 keyboard->repeat.timestamp = now;
729 if ((SDL_EventOK == NULL) 723 SDL_PushEvent(&keyboard->repeat.evt);
730 || SDL_EventOK(SDL_EventOKParam,
731 &keyboard->repeat.evt)) {
732 SDL_PushEvent(&keyboard->repeat.evt);
733 }
734 } 724 }
735 } 725 }
736 } 726 }
737 } 727 }
738 } 728 }