html的button的id,android - Tasker and AutoInput fails to click HTML button by ID field - Stack Overflo...

TL;DR

AutoInput does not click HTML buttons with an ID, even though EasySetup sees the ID and suggests it.

Background

I am making a HTML based board game timer, and I want to hook up a cheap bluetooth remote control to allow ending the current turn, passing a round etc. The remote sends VolumeUp, which I hope to capture using Tasker and AutoInput and redirect to a Click action on a button on my timer.

The Problem

The AutoInput click action times out. If I change it to find the button using the Text of the button and not the ID, then it works. Unfortunately, the 'action-play-pause' button changes the text depending on if the button is a 'Resume Game' button or 'Pause Game' button. (the id stays the same)

What I've tried so far

SGT PlayPause (this does not work)

A1: AutoInput Action [

Configuration:Type: Id

Value: action-play-pause

Action : Click Timeout (Seconds):1 Structure Output (JSON, etc):On Continue Task After Error:On

]

A2: Flash [ Text:%errmsg Long:Off ] If [ %errmsg Set ]

SGT Primary (this works)

A1: AutoInput Action [

Configuration:Type: Text

Value: End Turn

Action : Click Timeout (Seconds):1 Structure Output (JSON, etc):On Continue Task After Error:On

]

A2: Flash [ Text:%errmsg Long:Off ] If [ %errmsg Set ]

If you want to try this yourself, I've set up a very simple HTML page with these buttons here: https://parakoos.github.io/

All it is is buttons like these:

End Turn

Pass

Play Pause

The real strange thing is that the action configurations were set up using the EasySetup mode, where clicking the button correctly identifies the ID field and suggest I use it. Only, it then never actually finds it when I actually trigger the action.

Alternatives Considered

If I am unable to make Tasker click the buttons based on ID, is there a way I could get the current text of a button (based on the ID) and then use that in a variable for the click action?

Alternatively, if I could convert the VolumeUp commands to 'Enter' key presses, then I could listen to those in my app and react to them. (I already have that in place in fact.) But I don't know how to simulate Enter key presses using Tasker.

Can anyone shed some light on this situation? I'd be very grateful.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值