XYSDK.h
void setkeyboardtype (int type);
XYSDK.cpp
void XYSDK :: Setkeyboardtype (int type)
{
#if (Cc_target_platform = = Cc_platform_ios)
cceglview * pglview =ccdirector::shareddirector() Getopenglview();
if (Pglview)
{
if (0==type) {
pglview->setimekeyboarddefault();
}Elseif (1 ==type) {
pglview->setimekeyboardnumber();
}
pglview->setimekeyboardstate(true);
}
#endif
}
Cceglview
void Cceglview :: Setimekeyboardnumber ()
{
eaglview * view = [eaglviewsharedeglview];
view. Keyboardtype = uikeyboardtypenumbersandpunctuation ;
}
void Cceglview :: Setimekeyboarddefault ()
{
eaglview * view = [eaglviewsharedeglview];
view. Keyboardtype = Uikeyboardtypedefault ;
}
Jsb_xy.hpp
Jsbool Js_xy_xysdk_setkeyboardtype (jscontext *cx,uint32_t argc, Jsval *VP);
Jsb_xy.cpp
Jsbool Js_xy_xysdk_setkeyboardtype (jscontext *cx,uint32_t argc,jsval *VP)
{
jsval *argv =js_argv(CX, VP);
jsbool ok =js_true;
jsobject *obj =js_this_object(CX, VP);
js_proxy_t *proxy =jsb_get_js_proxy(obj);
xysdk* cobj = (xysdk *) (proxy?proxy->ptr : NULL);
jsb_precondition2(CObj, CX,js_false, "invalidnative Object" );
if (argc = =1) {
int arg0;
OK &= jsval_to_int32(CX, argv[0], (int32_t *) &ar G0);
jsb_precondition2(OK, CX,js_false, "Error processing argumen TS ");
cobj->setkeyboardtype(arg0);
js_set_rval(CX, VP,jsval_void);
returnjs_true;
}
js_reporterror(CX,"wrong number of arguments:%d, was expecting%d", ARGC,1);
returnjs_false;
}
Use
in the JS file, Attachwithime before setting Setkeyboardtype
setkeyboardtype (0)// default Keyboard
Setkeyboardtype (1) // numeric keypad
XY. Xysdk.getinstance (). Setkeyboardtype (1);
        this ._mainui.getwidgetbyname ( "Textfield_shu_ru "