Skip to content

Commit

Permalink
TestActivity: show key presses (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
pazos authored Sep 30, 2024
1 parent b64feb5 commit a2a6f2c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/src/main/java/org/koreader/launcher/TestActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package org.koreader.launcher
import android.graphics.Point
import android.text.method.LinkMovementMethod
import android.util.Log
import android.view.KeyEvent
import android.widget.ArrayAdapter
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
Expand Down Expand Up @@ -145,6 +146,13 @@ class TestActivity: AppCompatActivity() {
super.onDestroy()
Log.i(tag, MARKER_END)
}

override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
val msg = String.format("Pressed: %d", keyCode)
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show()
return super.onKeyDown(keyCode, event)
}

private fun runLights(id: String) {
lightsMap[id]?.let { driver ->
Log.i(tag, String.format("running lights test: %s", id))
Expand Down

0 comments on commit a2a6f2c

Please sign in to comment.