-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
physical keyboard input support #60
Comments
We are planning to make Dart SDK 2.17, so I think we will merge this with a major version upgrade. |
there would be alot of benefits in using actual textfields behind the scenes. An idea would be to use the following package: This would come with quite a bit of restructuring as Secrets would have to be built very differently. |
If you think it would be interesting to look into the |
Thank you for all your help. |
after working on a completely unrelated package, I now have new knowledge. @override
Widget build(BuildContext context) {
return KeyboardListener(
focusNode: _focusNode,
onKeyEvent: (key) {
if (key is! KeyDownEvent) return;
if (widget.inputButtonConfig.inputStrings.contains(key.character)) {
widget.inputState.addCharacter(key.character!);
} else if (key.logicalKey == LogicalKeyboardKey.backspace) {
widget.inputState.removeCharacter();
}
},
child: widget.child,
);
} essentially we can ignore all key events which arent "down" meaning the key is being pressed. |
It would be great if the package supported input via a physical keyboard.
I have already tested a rough implementation of this:
It can be used as a widget wrapped around a keypad to enter a PIN code from the keyboard.
There are some issues with delays. KeyEvent can be triggered very fast.
Maybe only add delay on backspace? not sure.
I probably won't make a pull request. I don't want to change the structure of your project too much.
But I think this feature is a great addition.
The text was updated successfully, but these errors were encountered: