mirror of
https://github.com/geode-sdk/android-launcher.git
synced 2026-10-28 10:10:31 +00:00
add edittext methods
This commit is contained in:
8 files changed
+257
-40
No files matched your search
@@ -0,0 +1,34 @@
|
||||
package org.cocos2dx.lib
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.KeyEvent
|
||||
import androidx.appcompat.widget.AppCompatEditText
|
||||
|
||||
class Cocos2dxEditText : AppCompatEditText {
|
||||
private var mCocos2dxGLSurfaceView: Cocos2dxGLSurfaceView? = null
|
||||
|
||||
constructor(context: Context) : super(context) {}
|
||||
constructor(context: Context, attrs: AttributeSet) : super(
|
||||
context, attrs
|
||||
) {
|
||||
}
|
||||
|
||||
constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(
|
||||
context, attrs, defStyle
|
||||
) {
|
||||
}
|
||||
|
||||
fun setCocos2dxGLSurfaceView(pCocos2dxGLSurfaceView: Cocos2dxGLSurfaceView?) {
|
||||
mCocos2dxGLSurfaceView = pCocos2dxGLSurfaceView
|
||||
}
|
||||
|
||||
override fun onKeyDown(pKeyCode: Int, pKeyEvent: KeyEvent): Boolean {
|
||||
super.onKeyDown(pKeyCode, pKeyEvent)
|
||||
if (pKeyCode != 4) {
|
||||
return true
|
||||
}
|
||||
mCocos2dxGLSurfaceView!!.requestFocus()
|
||||
return true
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user