ANDROID: Improve keyboard support (#1857)

This commit is contained in:
Cameron Cawley 2019-12-14 12:48:47 +00:00 committed by Antoniou Athanasios
parent 9a2371ddfb
commit d584df6a0e
3 changed files with 216 additions and 25 deletions

View file

@ -239,15 +239,15 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
break;
}
if (arg4 & JMETA_SHIFT)
if (arg4 & JMETA_SHIFT_MASK)
e.kbd.flags |= Common::KBD_SHIFT;
// JMETA_ALT is Fn on physical keyboards!
// when mapping this to ALT - as we know it from PC keyboards - all
// Fn combos will be broken (like Fn+q, which needs to end as 1 and
// not ALT+1). Do not want.
//if (arg4 & JMETA_ALT)
//if (arg4 & JMETA_ALT_MASK)
// e.kbd.flags |= Common::KBD_ALT;
if (arg4 & (JMETA_SYM | JMETA_CTRL))
if (arg4 & (JMETA_SYM_ON | JMETA_CTRL_MASK))
e.kbd.flags |= Common::KBD_CTRL;
pushEvent(e);
@ -281,7 +281,7 @@ void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,
// the longer the button held, the faster the pointer is
// TODO put these values in some option dlg?
int f = CLIP(arg4, 1, 8) * _dpad_scale * 100 / s;
int f = CLIP(arg5, 1, 8) * _dpad_scale * 100 / s;
if (arg2 == JKEYCODE_DPAD_UP || arg2 == JKEYCODE_DPAD_LEFT)
*c -= f;