报这个错,什么情况?还有就是,unity怎么重写键盘监听呐,求大神指点一二
Assets/Script/MidiKeyEvents.cs(36,38): error CS0246: The type or namespace name `KeyDownHandler' could not be found. Are you missing a using directive or an assembly reference?
internal class KeyInputMonitor
{
// 创建一个委托,返回类型为void,两个参数
**** public delegate void KeyDownHandler( object sender, KeyEventArgs e );****
// 将创建的委托和特定事件关联,在这里特定的事件为KeyDown
public event KeyDownHandler KeyDown;
public void Run()
{
bool finished = false;
do
{
Console.WriteLine( "Input a char" );
string response = Console.ReadLine();
char responseChar = ( response == "" ) ? ' ' : char.ToUpper( response[0] );
switch( responseChar )
{
case 'X':
finished = true;
break;