Hello Guest

LWJGL3 - Mouse + Keyboard

  • 1 Replies
  • 2093 Views
*

Offline abcdef

  • ****
  • 322
LWJGL3 - Mouse + Keyboard
« 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?

*

Offline spasi

  • *****
  • 2172
    • WebHotelier
Re: LWJGL3 - Mouse + Keyboard
« Reply #1 on: November 27, 2014, 19:18:21 »
1) Is there an equivalent to Mouse.setGrabbed(true)?

Code: [Select]
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
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?

It's GLFW_KEY_GRAVE_ACCENT.

3) 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.