java - libgdx desktop project is catching the back key -
i'm making game using libgdx. in android build game want catch key , pause game. in desktop build want catch escape key pause game.
i've done in previous game catching both escape , key in base project (no platform specific code). there's not show relevant code:
gdx.input.setinputprocessor(mstage); gdx.input.setcatchbackkey(true); if(gdx.input.iskeypressed(keys.back) || gdx.input.iskeypressed(keys.escape) ) { mpaused = true; }
the problem i'm having desktop version of game seemed getting stuck paused sometimes. putting breakpoint on above condition when got stuck found out gdx.input.iskeypressed(keys.back)
part of condition true.
at first thought happening when pressing escape, seems can press key , cause button stuck on (i.e. doesn't stuck first press after 10-15 key presses, of key, gets stuck).
from i've searched libgdx, thought key android , there isn't equivalent button pc.
i know modify code desktop version catches escape button, i'm more interested in why happening.
what can cause libgdx catch key on pc?
looks both back
, meta_sym_on
have same keycode (4). see http://libgdx.badlogicgames.com/nightlies/docs/api/constant-values.html#com.badlogic.gdx.input.keys.back.
i'm not sure these numbers coming from, suspect underlying platform (android or lwjgl), overlap unavoidable.
i'm not sure meta_sym_on
corresponds (one of alt keys?) may not relevant. seem should stick checking platform-specific keys on relevant platform (since there no guarantee that key isn't else on platform).
Comments
Post a Comment