示例#1
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);
		}
示例#2
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;
		}