comparison input/input.c @ 33017:cc8cef372901

Make "stuck keys" problem impossibly by resetting the internal key state when our key fifo overflowed.
author reimar
date Thu, 24 Mar 2011 22:11:18 +0000
parents 0c5bb45690ea
children 03ed899a72bc
comparison
equal deleted inserted replaced
33016:88a7bd86e3ac 33017:cc8cef372901
1098 interpret_key(int code, int paused) 1098 interpret_key(int code, int paused)
1099 { 1099 {
1100 unsigned int j; 1100 unsigned int j;
1101 mp_cmd_t* ret; 1101 mp_cmd_t* ret;
1102 1102
1103 if (code == MP_KEY_RELEASE_ALL) {
1104 memset(key_down, 0, sizeof(key_down));
1105 num_key_down = 0;
1106 last_key_down = 0;
1107 return NULL;
1108 }
1109
1103 if(mp_input_key_cb) { 1110 if(mp_input_key_cb) {
1104 if (code & MP_KEY_DOWN) 1111 if (code & MP_KEY_DOWN)
1105 return NULL; 1112 return NULL;
1106 code &= ~(MP_KEY_DOWN|MP_NO_REPEAT_KEY); 1113 code &= ~(MP_KEY_DOWN|MP_NO_REPEAT_KEY);
1107 if (mp_input_key_cb(code)) 1114 if (mp_input_key_cb(code))