gpt4 book ai didi

keyboard - 如何让 flutter 应用程序支持电视设备?

转载 作者:IT王子 更新时间:2023-10-29 06:44:32 27 4
gpt4 key购买 nike

电视设备不支持触摸操作,用户必须使用 Remote 。我们需要通过按左、上、右、下方向键来移动焦点,当目标控件获得焦点时,我们将按下 OK 按钮来响应各种按键事件。但是我找不到任何flutter接口(interface)来解决这个交互,谁能帮帮我?

最佳答案

为此有 SystemChannels。我自己还没有尝试过,但看起来这应该可以满足您的需要:

DartDocs - SystemChannels.keyEvent

A JSON BasicMessageChannel for keyboard events.

[DartDocs - SystemChannels.textInput[( https://www.dartdocs.org/documentation/flutter/0.0.41-dev/services/SystemChannels/textInput-constant.html )

A JSON MethodChannel for handling text input.

This channel exposes a system text input control for interacting with IMEs (input method editors, for example on-screen keyboards). There is one control, and at any time it can have one active transaction. Transactions are represented by an integer. New Transactions are started by TextInput.setClient. Messages that are sent are assumed to be for the current transaction (the last "client" set by TextInput.setClient). Messages received from the shell side specify the transaction to which they apply, so that stale messages referencing past transactions can be ignored.

后者在https://github.com/flutter/flutter/blob/4389f07024a4c69f7223401abd4d0ab3ecc45698/packages/flutter/lib/src/services/text_input.dart中使用

物理键盘存在已知问题,可能会导致此用例无法正常工作

关于keyboard - 如何让 flutter 应用程序支持电视设备?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47844928/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com