Author Topic: libjcsi keyboard input  (Read 6231 times)

penguin_buddha

  • Newcomer
  • Posts: 19
  • Karma: +0/-0
    • View Profile
    • Email
libjcsi keyboard input
« 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.

XLambda

  • Rogueliker
  • ***
  • Posts: 208
  • Karma: +0/-0
    • MSN Messenger - tau_iota@live.de
    • View Profile
    • The Weird Rogue
Re: libjcsi keyboard input
« Reply #1 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?

penguin_buddha

  • Newcomer
  • Posts: 19
  • Karma: +0/-0
    • View Profile
    • Email
Re: libjcsi keyboard input
« Reply #2 on: September 13, 2012, 02:33:16 PM »
32 bit win7