holyfuzz's picture

Unicode keyboard input...

Hi,

I'm looking at OpenTK as a possible friendlier alternative to Tao. I've been looking at the GameWindow and KeyboardDevice classes, but I see no way to capture unicode keyboard input in the same way that I can using Winforms or SDL. Am I missing something, or is there no such feature? I'd really like to use GameWindow if at all possible because it supports some features that SDL does not.

If there is no such feature then perhaps I will just stick with my current Tao.Sdl implementation for windowing/input and use OpenTK for OpenGL/OpenAL. (No reason this shouldn't work right?)

Thanks!


Comments

Comment viewing options

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

#759: [GameWindow] Add character information to input events (in progress)

You can use Tao.Sdl with OpenTK, as long as you call:

var context = OpenTK.Graphics.GraphicsContext.CreateDummyContext();

right after you create the SDL window. Don't forget to store the dummy context somewhere, so it's not collected by the GC.

holyfuzz's picture

CreateDummyContext() is crashing (NullReferenceException). Here's my code:

if(Sdl.SDL_SetVideoMode(width, height, depth, flags) == IntPtr.Zero)
throw new SDLException();
_dummyContext = GraphicsContext.CreateDummyContext();

Any ideas? Thanks.

FYI, I'm using 0.9.8.

the Fiddler's picture
holyfuzz's picture

Yeah, looks like that bug.

I think I'll be sticking with Tao for now, until either CreateDummyContext() gets fixed or (preferably) GameWindow gets unicode support.

the Fiddler's picture

If this is not too difficult, could you please check whether this problem persists in 0.9.9?

holyfuzz's picture

Yes, the problem seems to persist in 0.9.9.

(If it matters, the 0.9.9 was downloaded from http://www.opentk.com/files/opentk-0.9.9.html)

(FYI, I noticed that the file downloaded by http://www.opentk.com/files/opentk-0.9.8-1.html is opentk-0.9.9.zip, not 0.9.8.)

the Fiddler's picture

Thanks.

Good catch on the download. Sourceforge changed its download locations recently - should be fixed now.