-- Wireless Keyboard Sender (Remote Side) - with paste support -- Find modem automatically local modemSide = nil for _, side in ipairs(redstone.getSides()) do if peripheral.isPresent(side) and peripheral.getType(side) == "modem" then modemSide = side break end end if not modemSide then print("Error: No modem found!") return end rednet.open(modemSide) term.clear() term.setCursorPos(1, 1) print("=== Wireless Keyboard Sender ===") print("Type to send to remote host") print("Ctrl+V to paste | Ctrl+T to stop") print("---------------------------------") write("> ") while true do local event, param = os.pullEvent() if event == "char" then -- Send normal character rednet.broadcast(param) write(param) elseif event == "paste" then -- Send full pasted text rednet.broadcast(param) write(param) elseif event == "key" then if param == keys.backspace then rednet.broadcast("\b") local x, y = term.getCursorPos() if x > 3 then term.setCursorPos(x - 1, y) term.write(" ") term.setCursorPos(x - 1, y) end elseif param == keys.enter then rednet.broadcast("\n") print("") write("> ") end end end