INKEY$ not recognizing some keys

Previous topic - Next topic

BasicMe

Don't know if this is a known issue or not, but here's the code:

Code (glbasic) Select

loop:
  a$=INKEY$()
  IF a$<>""
    b$=b$+a$
    PRINT b$, 0, 0
    SHOWSCREEN
  ENDIF
GOTO loop

On my laptop (Windows 7 x64), it recognizes all of the basic letters & number keys.  However, some oddness:

- it does not recognize the regular plus key (however, it DOES recognize the plus key on the numeric keypad);

- it recognizes the regular forward-slash key, but not the forward-slash key on the numeric keypad;

- the backslash shows up as a right bracket; the right bracket shows up as a left bracket; and the left bracket key isn't recognized at all;

- it does not recognize the quote-marks key or the tilde key.

Moru

#1
Swedish keyboard:

  • Both plus works
  • Shift+7 gives forward slash but num keypad don't
  • No numbers works on numpad (numlock on or off) but all signs except forward slash works
  • button left to backspace says "4"
  • Swedish characters ÅÄÖ = EDV (some unicode problem?) Working fine, user-error :-)

SHOWSCREEN is placed inside the IF statement in the example above, causing troubles with exiting the program.

Code (glbasic) Select

LOCAL a$, b$, c$

WHILE TRUE
a$=INKEY$()
IF a$<>""
b$=b$+a$
c$ = a$
ENDIF
PRINT b$, 0, 0
PRINT ASC(c$), 0, 12
SHOWSCREEN
WEND


MrTAToad

Regular + key detect on my Windows 7 x64 machine.  As well as backward and forward slashes, tilde and quotes

[attachment deleted by admin]

Moru


Ian Price

There are some oddities on UK laptop keyboards too. IIRC the left and right shift keys should be #42 and #54, but on my lappy, the left shift key is #0. Strangely, I have a touch-sensitive volume control, which uses the designated left shift key value.
I came. I saw. I played.

MrTAToad

Quote from: Moru on 2010-Jul-27
How about numpad then?
No keys on the numpad are detected, except *,-, +

BasicMe

Wow. For the record, my laptop is from the US (HP). It doesn't sound like this problem is consistent from one region to another (or maybe from one hardware manufacturer to another?), so it may not be possible to fix.   :doubt:

Quote from: Moru
SHOWSCREEN is placed inside the IF statement in the example above, causing troubles with exiting the program.

Heh...yes, you're right.  My bad.   :-[

Moru

Ofcourse it can be fixed, every other game can handle this just fine. It's just a little bug that Gernot will take care of as soon as he has time for it.