【问题标题】:How to detect keyboard input with TVML/TVJS如何使用 TVML/TVJS 检测键盘输入
【发布时间】:2015-11-03 22:01:14
【问题描述】:

正如标题所示,我想知道如何使用 TVML 模板和使用 Apple Catalog Project 中的 TVJS 设计模式检测键盘输入

例如:当显示 Search.xml.js 时,用户在键盘上选择了 'a' 键,如何检测到他们选择了 'a' 键?

【问题讨论】:

    标签: tvos apple-tv tvml tvjs


    【解决方案1】:

    在深入研究 Apple Docs 之后,我找到了答案。

    这是Keyboard onTextChange的参考

    以下是它的使用示例:

    var doc = Presenter.makeDocument(resource);
    var searchField = doc.getElementById("SearchField"); //I added an id to the searchField to make it easy to access.
    var keyboard = searchField.getFeature("Keyboard");
        keyboard.onTextChange = function () {                                
          swiftLog(keyboard.text);
        };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-09-10
      • 2015-02-16
      • 1970-01-01
      • 2014-04-18
      • 1970-01-01
      • 1970-01-01
      • 2011-06-09
      • 2017-11-23
      相关资源
      最近更新 更多