Create widget that sends various keystrokes one after the other
I'm a noob when it comes to unified remote and scripting.
What I am trying to achieve is a single widget that will effectively press the enter button then type some fixed text then press enter again I've tried looking for whether there is already a discussion for this but haven't had any luck. All help is appreciated.
This is where you will find help on this, and other commands:
[email protected] type some text actions.type_some_text = function() kb.stroke("enter"); kb.text("hello world"); kb.stroke("enter"); end
You then need to put that in a custom remote, then base a widget on the actions in that remote.
So essentially your remote.lua file will look like this:
local kb = libs.keyboard; [email protected] type some text actions.type_some_text = function() kb.stroke("enter"); kb.text("hello world"); kb.stroke("enter"); end
And your layout.xml will look like this:
<?xml version="1.0" encoding="utf-8"?> <layout> <button text="type some text" ontap="type_some_text" /> </layout>
You could look at that custom remote in the UR app if you wanted, but really you are just creating it so you can base your widget on the action, same as mine (Loungeroom PC).