Class cc.imeDispatcher

Class Summary
Constructor Attributes Constructor Name and Description
 
cc.imeDispatcher is a singleton object which manage input message dispatching.

Method Summary

Class Detail

cc.imeDispatcher()
cc.imeDispatcher is a singleton object which manage input message dispatching.

Method Detail

  • addDelegate(delegate)
    Add delegate to concern ime msg
    //example
    cc.imeDispatcher.addDelegate(this);
    Parameters:
    {cc.IMEDelegate} delegate
  • {Boolean} attachDelegateWithIME(delegate)
    Attach the pDeleate with ime.
    //example
    var ret = cc.imeDispatcher.attachDelegateWithIME(this);
    Parameters:
    {cc.IMEDelegate} delegate
    Returns:
    {Boolean} If the old delegate can detattach with ime and the new delegate can attach with ime, return true, otherwise return false.
  • ctor()
    Constructor function, override it to extend the construction behavior, remember to call "this._super()" in the extended "ctor" function.
  • {Boolean} detachDelegateWithIME(delegate)
    Detach the pDeleate with ime.
    //example
    var ret = cc.imeDispatcher.detachDelegateWithIME(this);
    Parameters:
    {cc.IMEDelegate} delegate
    Returns:
    {Boolean} If the old delegate can detattach with ime and the new delegate can attach with ime, return true, otherwise return false.
  • dispatchDeleteBackward()
    Dispatch the delete backward operation
  • dispatchInsertText(text, len)
    Dispatch the input text from ime
    Parameters:
    {String} text
    {Number} len
  • dispatchKeyboardDidHide(info)
    Dispatch keyboard notification
    Parameters:
    {cc.IMEKeyboardNotificationInfo} info
  • dispatchKeyboardDidShow(info)
    Dispatch keyboard notification
    Parameters:
    {cc.IMEKeyboardNotificationInfo} info
  • dispatchKeyboardWillHide(info)
    Dispatch keyboard notification
    Parameters:
    {cc.IMEKeyboardNotificationInfo} info
  • dispatchKeyboardWillShow(info)
    Dispatch keyboard notification
    Parameters:
    {cc.IMEKeyboardNotificationInfo} info
  • {String} getContentText()
    Get the content text, which current CCIMEDelegate which attached with IME has.
    Returns:
    {String}
  • processKeycode(keyCode)
    Process keydown's keycode
    //example
    document.addEventListener("keydown", function (e) {
         cc.imeDispatcher.processKeycode(e.keyCode);
    });
    Parameters:
    {Number} keyCode
  • removeDelegate(delegate)
    Remove the delegate from the delegates who concern ime msg
    //example
    cc.imeDispatcher.removeDelegate(this);
    Parameters:
    {cc.IMEDelegate} delegate