better input
This commit is contained in:
parent
2a9ff10eae
commit
f8903877e2
1 changed files with 11 additions and 6 deletions
|
|
@ -243,14 +243,19 @@ class _RemotePageState extends State<RemotePage> {
|
|||
_value, // trick way to make backspace work always
|
||||
keyboardType: TextInputType.multiline,
|
||||
onChanged: (x) {
|
||||
var char = x[x.length - 1];
|
||||
if (x.length <= _value.length) {
|
||||
char = 'VK_BACK';
|
||||
} else if (char == '\n') {
|
||||
char = 'VK_RETURN';
|
||||
}
|
||||
if (char != '' && char != null)
|
||||
final char = 'VK_BACK';
|
||||
FFI.inputKey(char);
|
||||
}
|
||||
for (var i = _value.length;
|
||||
i < x.length;
|
||||
++i) {
|
||||
var char = x[i];
|
||||
if (char == '\n') {
|
||||
char = 'VK_RETURN';
|
||||
}
|
||||
FFI.inputKey(char);
|
||||
}
|
||||
_value = x;
|
||||
},
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue