Hello Guest

Disabling Input in Window class?

  • 7 Replies
  • 7645 Views
Disabling Input in Window class?
« on: July 15, 2004, 23:48:38 »
G'day all,
My name is Adrian Hofman and I'm developing a games engine in java as part of a team for Charles Sturt University in NSW Australia.

In short, I really just want to know if theres any way to disable the input stuff that appears to be going on in the Window.create() and Window.update() methods. It's conflicting with our current implementation, and we don't necessarily want to use the lwjgl input system.

Please help?

*

Offline Matzon

  • *****
  • 2242
Disabling Input in Window class?
« Reply #1 on: July 16, 2004, 01:16:14 »
you should be able to call Mouse.destroy() after the window has been created - else you can set either of these two to disable all input or just mouse input:
org.lwjgl.opengl.Display.noinput
org.lwjgl.opengl.Display.nomouse
that is - pass it like this:
java -cp <classpath> -Dorg.lwjgl.opengl.Display.nomouse=true MyApp

Disabling Input in Window class?
« Reply #2 on: July 16, 2004, 01:34:11 »
Many thanks.
It is properly disabled when I use

org.lwjgl.opengl.Window.noinput

as opposed to

org.lwjgl.opengl.Display.noinput

as you suggested. Have I got an old version or something?

Disabling Input in Window class?
« Reply #3 on: July 16, 2004, 05:10:18 »
You probably have the last actual release 0.9a.  The CVS source has merged the funtionality of Display and Window into the Display class.
 jglover13

Disabling Input in Window class?
« Reply #4 on: July 17, 2004, 00:03:40 »
Ah yes, ok, thanks.

Just one final comment / critique (not trying to start a flame war): I think it is terrible OO design to have the Window (or now Display class) updating the Input system automatically. I have a lwjgl app that is updating the input system when I didnt even import the input package. Just imagine the rude shock I get when I find that just by initialising the lwjgl renderer, it is mucking up my current input implementation! The naming is misleading (what does Display have to do with input at all?), and nothing is mentioned in the JavaDocs. What im saying is, If I want to use the input system, I should have to explicitly say so in my code.

Just my two cents.

*

Offline Matzon

  • *****
  • 2242
Disabling Input in Window class?
« Reply #5 on: July 17, 2004, 09:18:27 »
The reason for this behaviour, is that 99.9% of all LWJGL users will make a Display, Mouse & Keyboard - We therefore decided to make it easy to use LWJGL for those 99.9%, and a "harder" for the remaining 0.1%.
However, I do agree that it can seem a bit odd that Display updates the Input stuff - it's just a lot easier to have it do it for you, since you're required to call Display.update() each tick anyway.

*

Offline elias

  • *****
  • 899
    • http://oddlabs.com
Disabling Input in Window class?
« Reply #6 on: July 17, 2004, 16:50:02 »
I'm curious as to what exactly is interfering with your implementation? Per default, the mouse is not even grabbed, so that shouldn't interfere with your input system. One thing Mouse did was reset the cursor position to the middle of the window, but I have removed that in CVS. So what's left?

 - elias

Disabling Input in Window class?
« Reply #7 on: July 18, 2004, 00:48:30 »
Matzon: Thats a fine reason and perfectly justified, but it really should be explained in the javadocs for Display.update().
 
elias: Our current implementation uses JInput. All i know is,  when I called Display.create or Display.update, JInput couldn't poll the keyboard. Calling destroy() on each of the lwjgl input classes (Keyboard, Mouse, Controller) after the create() and update() calls didn't make any difference.