You could try........

<button text="Alt-Tab" ondown="tab_held" onup="tab_up/> local tmr = require("timer"); actions.tab_held = function () keyboard.down("leftalt"); tid = tmr.interval(function () keyboard.stroke("tab"); end, 1000); end actions.tab_up = function () timer.cancel(tid); keyboard.up("leftalt"); end

ondown and onup might be the wrong way around (in the layout.xml code above)...... the doc suggests that is the case......?? https://github.com/unifiedremote/Docs/blob/dab9184f84c1d03ad118b69a89ad997d105153ea/controls/button.md#events
David.