Keyboard.getKeyIndex on Windows 98

Started by NateS, June 02, 2009, 22:17:25

Previous topic - Next topic

NateS

I have a user running Java 1.6.0_13 and a Turkish version of Windows 98. I am seeing Keyboard.getKeyIndex("INSERT") return Keyboard.KEY_NONE. How is this possible? It seems as if reflection doesn't work on Windows 98!? Anyone seen something like this before?

Not sure exactly what the LWJGL JAR version is. Maybe this could be written to the manifest? Is it available in the JAR elsewhere that I don't know about? The LWJGL native library version is 21. The decompiled code that loads the keyMap is:

static {
		keyName = new String[255];
		keyMap = new HashMap(253);
		Field field[] = (org.lwjgl.input.Keyboard.class).getFields();
		try {
			for (int i = 0; i < field.length; i++)
				if (Modifier.isStatic(field[i].getModifiers()) && Modifier.isPublic(field[i].getModifiers())
					&& Modifier.isFinal(field[i].getModifiers()) && field[i].getType().equals(Integer.TYPE)
					&& field[i].getName().startsWith("KEY_")) {
					int key = field[i].getInt(null);
					String name = field[i].getName().substring(4);
					keyName[key] = name;
					keyMap.put(name, new Integer(key));
					counter++;
				}

		} catch (Exception e) {
		}
		keyCount = counter;
	}


I can ask my user to run a test program to try to figure out what is going on, but I wanted to first check if you guys had seen this before.

Ciardhubh

Quote from: NateS on June 02, 2009, 22:17:25
Not sure exactly what the LWJGL JAR version is. Maybe this could be written to the manifest? Is it available in the JAR elsewhere that I don't know about?

org.lwjgl.Sys.getVersion() tells you the jar version. Alternatively you can check (e.g. try to find the version string in a text editor or decompile it) /org/lwjgl/Sys.class in the jar, where the version is defined as a string, e.g. private static final String VERSION = "2.1.0";.

Matzon

fwiw, I am not aware of any devs testing on windows 98 ...

NateS

Thanks Ciardhubh. It was 2.0.1. <3 JADclipse! :)

Ahh, ok Matzon, thanks. I will make sure I don't list Windows 98 as compatible. However, I don't think the reflection code should fail. The failure doesn't seem LWJGL related. I guess I will blame the crappyness of Windows 98 and move on. :)

Ciardhubh

Oh by the way, Java 6 doesn't support Windows 98 anymore:
http://java.sun.com/javase/6/webnotes/install/system-configurations.html

You could ask your customer to try this Java 1.5 version or test it yourself:
http://www.java.com/en/download/windows98me_manual.jsp

Not sure whether LWJGL supports Win 98, but according to this site, at least compilation hasn't been tested:
http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/compilewin32

NateS

I did ask my user to try the Win98 version of Java 1.5, but apparently they lost focus and wandered off. Ah well. Thanks for the help!