Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
This might not answer your specific question but take a look at MonoGame an open source project that uses OpenTK under the hood. You can probably look at the source code as a reference. – craftworkgames Nov 23 '12 at 4:21

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
share|improve this answer
Note that the above is for 1.1, which is available through the SVN repository. As far as I know, OpenTK 1.0 doesn't have support for this. – Byte56 Sep 20 '13 at 22:14
As a side note, mouse does not work with 1.1 build on windows 7/8. There is patched version on github, which is currently the main repo for OpenTK: More info about the issue: – Lasse Oct 20 '13 at 23:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.