Then if you want to get the OpenTK equivalent of a pressed WinForms key just do: keys[Windows.Forms.Keys.A] and it will get you OpenTK.Input.Key.A
Of course to make such a list is boring work but you just have to type it one time :)
But indeed a (static) function for OpenTK-Key to WinForms-Key might be nice, any chance/interest in having this in the library? Is "clear out all WinForms dependencies" (which I think is a really nice and want to have thing) a problem here?
There is some overlap ranges in the enums, so I think it will be faster(little) to use "if, else if" statements. In those range, such as A-Z, just convert using: (OpenTK.Input.Keys)formsKey + offset
From experience this is usually no good thing to do since the codes may be different on other platforms, or even change for one platform (the system is still consistent then unless something relies on the castdown to e.g. integer).
Comments
Re: Windows.Forms.Keys to OpenTK.Input.Keys
You could make a Dictionary Map...
Then if you want to get the OpenTK equivalent of a pressed WinForms key just do: keys[Windows.Forms.Keys.A] and it will get you OpenTK.Input.Key.A
Of course to make such a list is boring work but you just have to type it one time :)
Re: Windows.Forms.Keys to OpenTK.Input.Keys
A large switch statement would be even faster than a dictionary.
Re: Windows.Forms.Keys to OpenTK.Input.Keys
But indeed a (static) function for OpenTK-Key to WinForms-Key might be nice, any chance/interest in having this in the library? Is "clear out all WinForms dependencies" (which I think is a really nice and want to have thing) a problem here?
Re: Windows.Forms.Keys to OpenTK.Input.Keys
There is some overlap ranges in the enums, so I think it will be faster(little) to use "if, else if" statements. In those range, such as A-Z, just convert using:
(OpenTK.Input.Keys)formsKey + offsetRe: Windows.Forms.Keys to OpenTK.Input.Keys
From experience this is usually no good thing to do since the codes may be different on other platforms, or even change for one platform (the system is still consistent then unless something relies on the castdown to e.g. integer).