fix key event

This commit is contained in:
csf
2022-05-07 18:04:00 +08:00
parent 368f4eb69e
commit 25187c8341
4 changed files with 140 additions and 469 deletions

View File

@@ -714,14 +714,14 @@ class FFI {
json.encode(modify({'type': type, 'buttons': button.value})));
}
static void inputKey(String name, [bool? down]) {
static void inputKey(String name, {bool? down, bool? press}) {
if (!ffiModel.keyboard()) return;
setByName(
'input_key',
json.encode(modify({
'name': name,
'down': (down ?? false).toString(),
'press': 'true'
'press': (press ?? true).toString()
})));
}