fix keyboard update-flag handler to only set flag when a mapped key has been pressed

Thu, 10 Feb 2011 01:09:04 +0000

author
Philip Pemberton <philpem@philpem.me.uk>
date
Thu, 10 Feb 2011 01:09:04 +0000
changeset 94
80872ecf64fa
parent 93
09e3ddeb869a
child 95
6e01339b218d

fix keyboard update-flag handler to only set flag when a mapped key has been pressed

src/keyboard.c file | annotate | diff | revisions
     1.1 --- a/src/keyboard.c	Thu Feb 10 01:08:32 2011 +0000
     1.2 +++ b/src/keyboard.c	Thu Feb 10 01:09:04 2011 +0000
     1.3 @@ -182,9 +182,6 @@
     1.4  			return;
     1.5  	}
     1.6  
     1.7 -	// If we got here, then the keystate must have changed...!
     1.8 -	ks->update_flag = true;
     1.9 -
    1.10  	// scan the keymap
    1.11  	for (int i=0; i < sizeof(keymap)/sizeof(keymap[0]); i++) {
    1.12  		if (keymap[i].key == ev->key.keysym.sym) {
    1.13 @@ -193,12 +190,14 @@
    1.14  				// Yes -- need ALT set when pressing the key for this to be a match
    1.15  				if (ev->key.keysym.mod & KMOD_ALT) {
    1.16  					ks->keystate[keymap[i].scancode] = v;
    1.17 +					ks->update_flag = true;
    1.18  					break;
    1.19  				}
    1.20  			} else {
    1.21  				// Standard Map key. ALT must NOT be pressed for this to be a match
    1.22  				if (!(ev->key.keysym.mod & KMOD_ALT)) {
    1.23  					ks->keystate[keymap[i].scancode] = v;
    1.24 +					ks->update_flag = true;
    1.25  					break;
    1.26  				}
    1.27  			}