Gekko's picture

How to use KeyDownEvent in F#

Hi!

Does anyone know how to use KeyDownEvent in F#? I have a hard time trying to figure out how to use it.

I'm developing a RPG game with F# and OpenTK.

- Gekko


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
objarni's picture

Looks nice!

Is this GLControl maximized or GameWindow?

the Fiddler's picture

This is a known issue: the Keyboard.KeyDown does not use the .Net convention (object sender, EventArgs e) which means F# cannot apply its syntactic sugar.

The short-term solution is to use the add_KeyDown() method instead. OpenTK.Input is being reworked in SVN trunk to fix those issues: the final API will be closer to XNA.

Gekko's picture

the Fiddler: Ok, thanks

objarni: It uses GameWindow.

- Gekko