Fixed spurious keypress at startup on BeOS
authorSam Lantinga <slouken@libsdl.org>
Thu, 11 Apr 2002 18:22:05 +0000
changeset 339 eed579d059ef
parent 338 518ffd98a8f6
child 340 b9f1ce709960
Fixed spurious keypress at startup on BeOS
src/video/bwindow/SDL_sysevents.cc
--- a/src/video/bwindow/SDL_sysevents.cc	Thu Apr 11 15:23:07 2002 +0000
+++ b/src/video/bwindow/SDL_sysevents.cc	Thu Apr 11 18:22:05 2002 +0000
@@ -288,9 +288,12 @@
 {
 	unsigned int i;
 
-	/* Initialize all the key states as "up" */
+	/* Initialize the keyboard state */
 	key_flip = 0;
-	memset(keyinfo[key_flip].key_states, 0, 16);
+	get_key_info(&keyinfo[key_flip]);
+	memcpy(keyinfo[!key_flip].key_states,
+	       keyinfo[key_flip].key_states,
+	       SDL_TABLESIZE(keyinfo[key_flip].key_states));
 
 	/* Initialize the BeOS key translation table */
 	/* Source: <be/interface/InterfaceDefs.h> and BeOS keyboard info */