From 6623e3c7efe1ebaa96f0ff9c5b8b8ea24b095d77 Mon Sep 17 00:00:00 2001 From: open-trade Date: Tue, 22 Dec 2020 15:26:35 +0800 Subject: [PATCH] hacking way for bracket issue --- flutter_hbb/lib/remote_page.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/flutter_hbb/lib/remote_page.dart b/flutter_hbb/lib/remote_page.dart index ff7b97ed7..72458a36e 100644 --- a/flutter_hbb/lib/remote_page.dart +++ b/flutter_hbb/lib/remote_page.dart @@ -45,7 +45,6 @@ class _RemotePageState extends State { @override void initState() { super.initState(); - _value = initText; FFI.connect(widget.id); WidgetsBinding.instance.addPostFrameCallback((_) { SystemChrome.setEnabledSystemUIOverlays([]); @@ -77,7 +76,6 @@ class _RemotePageState extends State { var v = MediaQuery.of(context).viewInsets.bottom; if (v != _bottom) { resetTool(); - _value = initText; setState(() { _bottom = v; if (v < 100) { @@ -141,6 +139,11 @@ class _RemotePageState extends State { char = 'VK_RETURN'; } FFI.inputKey(char); + final brackets = '("[<{(“【《{'; + if (brackets.indexOf(char) >= 0) { + openKeyboard(); + return; + } } } _value = newValue; @@ -148,6 +151,7 @@ class _RemotePageState extends State { void openKeyboard() { // destroy first, so that our _value trick can work + _value = initText; setState(() => _showEdit = false); _timer?.cancel(); _timer = Timer(Duration(milliseconds: 30), () {