コントローラの操作を処理する  |  Android デベロッパー  |  Android Developers
class Dpad { private var directionPressed = -1 // initialized to -1 fun getDirectionPressed(event: InputEvent): Int { if (!isDpadDevice(event)) { return -1 } // If the input event is a MotionEvent, check its hat axis values. ...
developer.android.com