title: Can't detect key press with hardware keyboard on android app (Kotlin)
body: <p>I am creating a simple application for my android tv box, which uses a webview object to show some streaming urls and choose beetween them with PGup and PGdown of a remote control (an hardware keyboard).</p>
  <p>I am overriding method onKeyUp, but unfortunately my app seem not to detect any key press.
  This is some code excerpt:</p>
  <pre><code>package com.dm.tutorialwebview
  
  import android.os.Bundle
  import android.support.v7.app.AppCompatActivity
  import android.view.KeyEvent
  import android.view.Menu
  import android.webkit.WebChromeClient
  import android.webkit.WebView
  import android.webkit.WebViewClient
  import android.util.Log
  import android.view.MotionEvent
  
  
  class MainActivity : AppCompatActivity() {
  
      var webview: WebView? = null
      data class Channel(val number: Int, val name:String, val url: String )
  
      object ChannelList {
          private val list = mutableListOf&lt;Channel&gt;()
          private var curChannel: Int = 0
  [..]
      }
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
  
          ChannelList.addItem(Channel(1,&quot;channel1&quot;,&quot;https://...3&quot;))
          ChannelList.addItem(Channel(2,&quot;channel2&quot;,&quot;https://...&quot;))
          ChannelList.addItem(Channel(3,&quot;channel3&quot;,&quot;https://...&quot;))
  
          webview = findViewById(R.id.myweb)
          webview!!.webViewClient = WebViewClient()
          webview!!.settings.javaScriptEnabled = false
          webview!!.webChromeClient = WebChromeClient()
          webview!!.settings.domStorageEnabled = true
          webview!!.settings.builtInZoomControls = false     
          webview!!.settings.setSupportZoom(false)           
          webview!!.overScrollMode = WebView.OVER_SCROLL_NEVER
          webview!!.settings.useWideViewPort = true
          webview!!.setInitialScale(1)
  
          webview!!.loadUrl(ChannelList.getChannelUrl())
  
      }
  
      override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean {
          Log.i(&quot;TAG&quot;, &quot;onKeyUp is been called&quot;);
          return when (keyCode) {
              KeyEvent.KEYCODE_PAGE_UP -&gt; {
                  ChannelList.nextChannel()
                  webview!!.loadUrl(ChannelList.getChannelUrl())
                  true
              }
              KeyEvent.KEYCODE_PAGE_DOWN -&gt; {
                  ChannelList.prevChannel()
                  webview!!.loadUrl(ChannelList.getChannelUrl())
                  true
              }
              KeyEvent.KEYCODE_1 -&gt; {
                  ChannelList.setChannel(1)
                  webview!!.loadUrl(ChannelList.getChannelUrl())
                  true
              }
              else -&gt; super.onKeyUp(keyCode, event)
          }
  
      }
  
  
  }
  </code></pre>
  <p>Method onKeyUp doesn't seem to be triggered at all.
  Any hints on what could be wrong with this code?</p>
  <p>Thanks and regards</p>