Ejemplo n.º 1
0
 protected virtual void Update()
 {
     if (ImeApiPlugin.ime_is_open())
     {
         UpdateImeUI();
     }
 }
Ejemplo n.º 2
0
 public virtual void OnButtonClicked()
 {
     if (key != Keys.None)
     {
         ImeApiPlugin.ime_simulate_key((int)key);
     }
 }
Ejemplo n.º 3
0
    public override void OnInputUpdated(uint prev_buttons, uint buttons, bool isShift = false)
    {
        if (m_CurrentStateId == -1)
        {
            return;
        }
        //
        InputTransform inputMapping = isShift?m_ShiftInputMappings[m_CurrentStateId]:m_InputMappings[m_CurrentStateId];

        if (inputMapping != null)
        {
            int buttonMask;
            for (int i = 0, imax = inputMapping.buttonMasksFrom.Length; i < imax; ++i)
            {
                buttonMask = inputMapping.buttonMasksFrom[i];
                //
                if ((prev_buttons & buttonMask) == 0 && (buttons & buttonMask) != 0)       // Down
                //
                {
                    ImeApiPlugin.ime_simulate_key(inputMapping.buttonMasksTo[i]);
                }
                else if ((prev_buttons & buttonMask) != 0 && (buttons & buttonMask) == 0)        // Up
                //
                {
                }
            }
        }
    }
Ejemplo n.º 4
0
        public virtual void CheckImeOpened()
        {
            bool isOpened = ImeApiPlugin.ime_is_open();

            if (isOpened != m_SelfActive)
            {
                m_Go.SetActive(m_SelfActive = isOpened);
            }
        }
Ejemplo n.º 5
0
 protected virtual void OnDestroy()
 {
     if (!CheckPlatform())
     {
         return;
     }
     //
     ImeApiPlugin.ime_exit();
 }
Ejemplo n.º 6
0
        protected virtual void Start()
        {
            if (!CheckPlatform())
            {
                Destroy(gameObject);
                return;
            }
            //
            ImeApiPlugin.ime_init();
            m_Go         = gameObject;
            m_SelfActive = m_Go.activeSelf;
            Juggler.Main.UpdateCall(CheckImeOpened, 0.0f, float.MaxValue);

            InitImeUI();
        }
Ejemplo n.º 7
0
        public virtual void UpdateImeUI()
        {
            ClearImeUI();
            string str;

            //
            str = ImeApiPlugin.ime_get_composition_string();
            if (m_CompositionText != null)
            {
                m_CompositionText.text = str;
            }
            //
            int i = 0, imax = ImeApiPlugin.ime_get_candidate_list_count();

            for (; i < imax; ++i)
            {
                str = ImeApiPlugin.ime_get_candidate_list_item(i);
                AddCandidate(i, str);
            }
        }