예제 #1
0
파일: DummyEdit.cs 프로젝트: corefan/urho
        public bool OnKey(View v, Keycode keyCode, KeyEvent e)
        {
            // This handles the hardware keyboard input
            if (e.IsPrintingKey)
            {
                if (e.Action == KeyEventActions.Down)
                {
                    ic.CommitText(Java.Lang.String.ValueOf(e.GetUnicodeChar(0)), 1);
                }
                return(true);
            }

            if (e.Action == KeyEventActions.Down)
            {
                SDLActivity.onNativeKeyDown(keyCode);
                return(true);
            }
            else if (e.Action == KeyEventActions.Up)
            {
                SDLActivity.onNativeKeyUp(keyCode);
                return(true);
            }

            return(false);
        }
예제 #2
0
        public override bool SendKeyEvent(KeyEvent e)
        {
            var keyCode = e.KeyCode;

            if (e.Action == KeyEventActions.Down)
            {
                if (e.IsPrintingKey)
                {
                    CommitText(Java.Lang.String.ValueOf(e.GetUnicodeChar(0)), 1);
                }
                SDLActivity.onNativeKeyDown(keyCode);
                return(true);
            }
            else if (e.Action == KeyEventActions.Up)
            {
                SDLActivity.onNativeKeyUp(keyCode);
                return(true);
            }

            return(base.SendKeyEvent(e));
        }