@@ -94,8 +94,8 @@ class PlayerActivity : GameActivity() {
94
94
private val surfaceHeight: Int
95
95
get() = mSurfaceView.height
96
96
97
- private external fun keydown (keyCode : Byte , keyChar : Char )
98
- private external fun keyup (keyCode : Byte , keyChar : Char )
97
+ private external fun keydown (keyTag : String )
98
+ private external fun keyup (keyTag : String )
99
99
private external fun requestContextMenu ()
100
100
private external fun runContextMenuCallback (index : Int )
101
101
private external fun clearContextMenu ()
@@ -178,11 +178,8 @@ class PlayerActivity : GameActivity() {
178
178
for (b in keys) {
179
179
b.setOnTouchListener { view: View , motionEvent: MotionEvent ->
180
180
val tag = view.tag as String
181
- val spl = tag.split(" " .toRegex(), limit = 2 ).toTypedArray()
182
- val by = spl[0 ].toByte()
183
- val c: Char = if (spl.size > 1 ) spl[1 ][0 ] else Char .MIN_VALUE
184
- if (motionEvent.action == MotionEvent .ACTION_DOWN ) keydown(by, c)
185
- if (motionEvent.action == MotionEvent .ACTION_UP ) keyup(by, c)
181
+ if (motionEvent.action == MotionEvent .ACTION_DOWN ) keydown(tag)
182
+ if (motionEvent.action == MotionEvent .ACTION_UP ) keyup(tag)
186
183
view.performClick()
187
184
false
188
185
}
0 commit comments