title: DT in a Shiny app: select one row at the time with UP and DOWN keyboard's buttons
body: <p>I have a DT object embed in a Shiny app. With the code below, I am able to select one row at the time with a left click of the mouse:</p>
  <pre><code>library(DT)
  library(shiny)
  library(tidyverse)
  
  ui &lt;- fluidPage(
    
    fluidRow(
      
      column(width = 12,
             DTOutput(outputId = &quot;table&quot;,
                      width = &quot;100%&quot;))
      
    )
    
  )
  
  server &lt;- function(input, output, session) {
    
    output$table &lt;- renderDT({
      
      datatable(data = iris,
                selection = &quot;single&quot;,
                rownames = FALSE,
                escape = FALSE,
                extension = &quot;KeyTable&quot;,
                options = list(pageLength = 10,
                               autoWidth = FALSE,
                               scrollX = TRUE,
                               keys = TRUE,
                               columnDefs = list(list(
                                 targets = 4,
                                 render = JS(
                                   &quot;function(data, type, row, meta) {&quot;,
                                   &quot;return type === 'display' &amp;&amp; data != null &amp;&amp; data.length &gt; 125 ?&quot;,
                                   &quot;'&lt;span title=\&quot;' + data + '\&quot;&gt;' + data.substr(0, 125) + '...&lt;/span&gt;' : data;&quot;,
                                   &quot;}&quot;)
                               ))),
                class = &quot;display&quot;)
      
    })
    
  }
  
  shinyApp(ui = ui,
           server = server)
  </code></pre>
  <p>However, I would like to obtain the same result with the UP and DOWN arrow of the keyboard. In this way, I can select (and automatically deselect) a row only through these two buttons, which is useful when the table is pretty long and there are lots of rows to check. Thanks for your help!</p>
  <p><strong>EDIT</strong>: I've modified the code to insert the extension &quot;KeyTable&quot; as suggested by <a href="https://stackoverflow.com/users/4375992/silentdevildoll">silentdevildoll</a>. Although I can move in the table's cells with the keyboard, I am still not able to select them with the UP and DOWN arrow.</p>