daily update on 20240528 by nitload youmu

This commit is contained in:
Nitload
2024-05-28 17:45:54 +08:00
parent de399e22c2
commit 70890e3e33
88 changed files with 10678 additions and 5761 deletions
@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Graphics
{
public partial class ViewModel
{
Dictionary<KeyboardKey, KeyBoardEvent> keyEventDictionary = new Dictionary<KeyboardKey, KeyBoardEvent>();
internal void InternalLoadInput(MethodInfo[] methods)
{
if (methods.Length == 0)
{
return;
}
foreach (MethodInfo m in methods) //find all methods decorated by RenderActivityAttribute
{
KeyEventAttribute attr = m.GetCustomAttribute<KeyEventAttribute>(false);
if (attr == null)
{
continue;
}
if (!m.IsStatic && (m.GetParameters().Length != 0) && (m.ReturnType != typeof(void)))
{
throw new NotSupportedException("A render activity cannot have parameters, returning value or be static.");
}
}
}
internal void InternalProcessInput()
{
}
}
public delegate void KeyBoardEvent(KeyboardKey key, KeyStatus status);
public delegate void MouseEvent(Mouse mouse, KeyStatus status);
public delegate void JoystickEvent(Joystick joystick, KeyStatus status);
}