are there any specific type of soft Keyboard avaible in cocos2d-x?

Hello,

Say if we use CCTextFieldTTF and we attach IME, there is a default soft keyboard present. But if we want to get some specific type of soft keyboard, fox example, the keyboard only with number and dot, the keyboard with Chinese character, are there any way to get it? Or we have to build them by ourselves?

thanks & best regards,

HouZhe

CCTextFieldTTF hasn’t wrapped this feature. You should hack into this class to custom your requirements.

Hi zhe hou,

So have you changed the default keyboard to what you need ?
I need to add 2 extra buttons to the default keyboard and need to change the text of return button…
Can you please tell me how can we acheive it?

Thanks in Advance.

CCTextFieldTTF still doesn’t allow that. You should look at CCEditBox in the extensions of cocos2d-x : there is a sample in the TestCpp project. It allows you to choose the preferred type of keyboard (the exact layout will depend on the device you use).

To add extra buttons, I don’t think it’s possible using CCEditBox. For iOS at least, you’ll probably have to hack that yourself in the iOS implementation. You can find information about how to do that on Stackoverflow for example.