This commit is contained in:
2026-03-24 18:17:18 +09:00
parent 68c16339ea
commit 466a819800
3 changed files with 31 additions and 0 deletions
@@ -309,6 +309,15 @@ open class NeoRssActivity : CommonActivity() {
return super.dispatchKeyShortcutEvent(event)
}
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
Blog.LOGE("onKeyDown >> $keyCode $event")
return super.onKeyDown(keyCode, event)
}
override fun onKeyUp(keyCode: Int, event: KeyEvent?): Boolean {
Blog.LOGE("onKeyUp >> $keyCode $event")
return super.onKeyUp(keyCode, event)
}
override fun dispatchGenericMotionEvent(ev: MotionEvent?): Boolean {
if ("Virtual".equals(ev?.device?.name)) return true
Blog.LOGE("keyEvent >>>>> dispatchGenericMotionEvent ${ev?.device?.name ?: ""}: ${ev} ")
@@ -340,6 +340,27 @@ class TokiFragment : RemoteGestureFragment(), PagedTextViewInterface,KeyEventHan
if (isUp) actionPrevEvent()
true
}
KeyEvent.KEYCODE_DPAD_DOWN -> {
if (isUp) onSwipeDown(2)
true
}
KeyEvent.KEYCODE_DPAD_UP -> {
if (isUp) {
val intent = Intent(Intent.ACTION_MAIN)
intent.addCategory(Intent.CATEGORY_HOME)
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(intent)
}
true
}
KeyEvent.KEYCODE_DPAD_LEFT -> {
if (isUp) actionPrevEvent()
true
}
KeyEvent.KEYCODE_DPAD_RIGHT -> {
if (isUp) actionNextEvent()
true
}
else -> false
}
}