LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: abcdef on November 27, 2014, 19:03:56

Title: LWJGL3 - Mouse + Keyboard
Post by: abcdef on November 27, 2014, 19:03:56
Some more small questions (I checked out the examples on github but couldn't see anything to help here)

1) Is there an equivalent to Mouse.setGrabbed(true)?

2) I couldn't see an equivalent key for "~" (Tilda), the GLFW documentation doesn't have this either. Is there a plan to emulate some of the missing keys?

3) I couldn't see Keyboard.enableRepeatEvents(boolean) either, would I need to emulate this?
Title: Re: LWJGL3 - Mouse + Keyboard
Post by: spasi on November 27, 2014, 19:18:21
Quote from: abcdef on November 27, 2014, 19:03:561) Is there an equivalent to Mouse.setGrabbed(true)?

glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);

Quote from: abcdef on November 27, 2014, 19:03:562) I couldn't see an equivalent key for "~" (Tilda), the GLFW documentation doesn't have this either. Is there a plan to emulate some of the missing keys?

It's GLFW_KEY_GRAVE_ACCENT.

Quote from: abcdef on November 27, 2014, 19:03:563) I couldn't see Keyboard.enableRepeatEvents(boolean) either, would I need to emulate this?

You don't need to enable it, you'll automatically get repeat key events with a GLFW_REPEAT action. You can choose to use it or ignore it.