请问uniapp用红外线遥控器,必须要先触屏一下,才能用遥控器控制咋办呀?是打包到安卓上,是那种安卓大屏,跟平板差不多,
用这个插件
https://ext.dcloud.net.cn/plugin?id=2548
加了 event.preventDefault()
const onKey = (event) => {
const keys1 = ['type', 'timeStamp']
const keys2 = ['altKey', 'code', 'ctrlKey', 'isComposing', 'key', 'location', 'metaKey', 'repeat', 'shiftKey']
const keys3 = ['char', 'charCode', 'keyCode', 'keyIdentifier', 'keyLocation', 'which']
const data = {}
keys1.concat(keys2, keys3).forEach(key => data[key] = event[key])
this.$ownerInstance.callMethod('onEvent', data)
event.preventDefault()
}
hbuidlerx 3.6.4.20220922
用了旧版hbuidlerx 不行
3.4.7
考虑代码问题,回退之前我没改过的版本
3.5.3的版本 的hbuilderx 是可以遥控按键有效的,3.4 / 3.4.7.20220422不行。3.6.2不行
https://ask.dcloud.net.cn/question/155454