I'm not sure if this is what you're asking or not but you can use some javascript code to simulate a click of an actionButton when you hit the return key from inside a textInput.
Save this js file in your app's working directory as returnClick.js supplying the ids you will use for your textInput and actionButton. In this case myText and myButton.
# returnClick.js
$(document).keyup(function(event) {
if ($("#myText").is(":focus") && (event.keyCode == 13)) {
$("#myButton").click();
}
});
The following app will render the text in your textInput but only when the actionButton is clicked, however you don't need to manually click the button, you can just hit the return key when inside the text box.
# app.R
library(shiny)
ui <- fluidPage(
# include your js script
tags$head(includeScript("returnClick.js")),
textInput("myText", "Text Input", placeholder = "Enter text then hit return"),
actionButton("myButton", "Go!"),
verbatimTextOutput("textOutput")
)
server <- function(input, output, session) {
output$textOutput <- renderText({
input$myButton # take a dependency on the button click
# isolate text input to only re-render when button is clicked
isolate(input$myText)
})
}
shinyApp(ui, server)