Temple of The Roguelike Forums

Development => Programming => Topic started by: penguin_buddha on September 12, 2012, 05:25:26 PM

Title: libjcsi keyboard input
Post by: penguin_buddha on September 12, 2012, 05:25:26 PM
I've been having trouble with libjcsi. I'm getting keyboard input via the inkey() method:

CharKey key = csi.inkey()

From this you can get the inputted character's code (key.code). The problem is many keys are giving the same code 116 rather than the code their supposed to. For example, CharKey.PLUS is 55, but the key.code i get when using either plus on the keyboard is 116. Any ideas on what my issue is? Many other keys return the same thing, 116.
Title: Re: libjcsi keyboard input
Post by: XLambda on September 12, 2012, 06:59:05 PM
I've been having trouble with libjcsi. I'm getting keyboard input via the inkey() method:

CharKey key = csi.inkey()

From this you can get the inputted character's code (key.code). The problem is many keys are giving the same code 116 rather than the code their supposed to. For example, CharKey.PLUS is 55, but the key.code i get when using either plus on the keyboard is 116. Any ideas on what my issue is? Many other keys return the same thing, 116.

116 is CharKey.NONE, which is returned if it can't identify the key (iirc). What platform are you running the JVM on?
Title: Re: libjcsi keyboard input
Post by: penguin_buddha on September 13, 2012, 02:33:16 PM
32 bit win7