Events and C#

Hello,
I find a ton of Java examples about OnGui Events, but nothing for C# :frowning: .
For a simple test I get this message:

Assets/Standard Assets/CIEConfig.cs(50,39): error CS0120: `UnityEngine.Event.keyCode’: An object reference is required for the nonstatic field, method or property

Here the code:
if (Event.current.functionKey){
Check = Event.keyCode;
}

I think there is a massive syntax error, but don´t know where to find the right one…

Thanks,

Change Event.keyCode to Event.current.keyCode.

thank´s for the replay :slight_smile:

Another question:

if (Event.current.Equals (Event.KeyboardEvent (“c”))){
do something
}
else {
do something other
}

When I try this comes a parsing error. Must I declare the event:
public delegate void EventHandler(Object sender, EventArgs e);
public event EventHandler NoDataEventHandler;

…solved, a missing bracket …