How to use Input in OpenTK 1.0? There is not much info around, some classes are unfinished.
What I want to achieve, is to be able to use input not only in OnUpdate function, but also in other classes created by myself.
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityHow to use Input in OpenTK 1.0? There is not much info around, some classes are unfinished.
What I want to achieve, is to be able to use input not only in OnUpdate function, but also in other classes created by myself.
Check out OpenTK.Input.
From there you can get access to OpenTK.Input.Mouse
and
Some examples from the page include:
To check whether a button is pressed:
using OpenTK.Input;
var mouse = Mouse.GetState();
if (mouse[MouseButton.Left])
{
// Left mouse button is pressed
}
To check whether a mouse button is not pressed:
using OpenTK.Input;`
var mouse = Mouse.GetState();
if (!mouse[MouseButton.Left])
{
// Left mouse button is not pressed
}