eobish
diff src/fblibsdl.c @ 4:ce0548d24918
mostly works
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 18 Jan 2015 13:30:30 +0200 |
parents | cdbcae5b3b98 |
children | 6a350c554e46 |
line diff
1.1 --- a/src/fblibsdl.c Sun Jan 18 05:51:51 2015 +0200 1.2 +++ b/src/fblibsdl.c Sun Jan 18 13:30:30 2015 +0200 1.3 @@ -155,7 +155,9 @@ 1.4 fb_inp.key[key] = state; 1.5 } 1.6 if(fb_cb.keyb) { 1.7 - fb_cb.keyb(key, state, fb_cb.keyb_data); 1.8 + if(fb_cb.keyb(key, state, fb_cb.keyb_data) == -1) { 1.9 + return -1; 1.10 + } 1.11 } else { 1.12 if(key == SDLK_ESCAPE) { 1.13 return -1; 1.14 @@ -173,7 +175,9 @@ 1.15 fb_inp.mbutton[ev.button.which] = state; 1.16 1.17 if(fb_cb.button) { 1.18 - fb_cb.button(ev.button.which, state, fb_inp.mx, fb_inp.my, fb_cb.button_data); 1.19 + if(fb_cb.button(ev.button.which, state, fb_inp.mx, fb_inp.my, fb_cb.button_data) == -1) { 1.20 + return -1; 1.21 + } 1.22 } 1.23 } 1.24 break; 1.25 @@ -182,7 +186,9 @@ 1.26 fb_inp.mx = ev.motion.x / scale; 1.27 fb_inp.my = ev.motion.y / scale; 1.28 if(fb_cb.motion) { 1.29 - fb_cb.motion(fb_inp.mx, fb_inp.my, fb_cb.motion_data); 1.30 + if(fb_cb.motion(fb_inp.mx, fb_inp.my, fb_cb.motion_data) == -1) { 1.31 + return -1; 1.32 + } 1.33 } 1.34 break; 1.35 }