fix stupid mistakes in keyboard code (i broke the build, w00t...)

Wed, 09 Feb 2011 15:43:48 +0000

author
Philip Pemberton <philpem@philpem.me.uk>
date
Wed, 09 Feb 2011 15:43:48 +0000
changeset 83
7d2f720daed8
parent 82
4c72b03ffdc0
child 84
0d903718da81

fix stupid mistakes in keyboard code (i broke the build, w00t...)

src/keyboard.c file | annotate | diff | revisions
     1.1 --- a/src/keyboard.c	Wed Feb 09 15:40:05 2011 +0000
     1.2 +++ b/src/keyboard.c	Wed Feb 09 15:43:48 2011 +0000
     1.3 @@ -124,8 +124,8 @@
     1.4  	{ SDLK_y,				0,	0x79 },	// Y
     1.5  	{ SDLK_z,				0,	0x7a },	// Z
     1.6  // Keycodes 7B, 7C, 7D not used
     1.7 -	{ SDLK_NUMLOCK,			0,	0x7e }	// Numlock
     1.8 -	{ SDLK_DELETE,			0,	0x7f },	// Dlete
     1.9 +	{ SDLK_NUMLOCK,			0,	0x7e },	// Numlock
    1.10 +	{ SDLK_DELETE,			0,	0x7f }	// Dlete
    1.11  };
    1.12  
    1.13  void keyboard_init(KEYBOARD_STATE *ks)
    1.14 @@ -142,15 +142,15 @@
    1.15  void keyboard_event(KEYBOARD_STATE *ks, SDL_Event *ev)
    1.16  {
    1.17  	// Ignore non-keyboard events
    1.18 -	if ((event->type != SDL_KEYDOWN) && (event->type != SDL_KEYUP)) return;
    1.19 +	if ((ev->type != SDL_KEYDOWN) && (ev->type != SDL_KEYUP)) return;
    1.20  
    1.21  	// scan the keymap
    1.22  	int keyidx = 0;
    1.23  	for (keyidx=0; keyidx < sizeof(keymap)/sizeof(keymap[0]); keyidx++) {
    1.24 -		if (keymap[keyidx].key == event->key.keysym.sym) break;
    1.25 +		if (keymap[keyidx].key == ev->key.keysym.sym) break;
    1.26  	}
    1.27  
    1.28 -	switch (event->type) {
    1.29 +	switch (ev->type) {
    1.30  		// key pressed
    1.31  		case SDL_KEYDOWN:
    1.32  			ks->keystate[keymap[keyidx].scancode] = 1;