GLBasic forum

Main forum => Bug Reports => Topic started by: BasicMe on 2010-Jul-27

Title: INKEY$ not recognizing some keys
Post by: BasicMe on 2010-Jul-27
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.
Title: Re: INKEY$ not recognizing some keys
Post by: Moru on 2010-Jul-27
Swedish keyboard:

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

Title: Re: INKEY$ not recognizing some keys
Post by: MrTAToad on 2010-Jul-27
Regular + key detect on my Windows 7 x64 machine.  As well as backward and forward slashes, tilde and quotes

[attachment deleted by admin]
Title: Re: INKEY$ not recognizing some keys
Post by: Moru on 2010-Jul-27
How about numpad then?
Title: Re: INKEY$ not recognizing some keys
Post by: Ian Price on 2010-Jul-27
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.
Title: Re: INKEY$ not recognizing some keys
Post by: MrTAToad on 2010-Jul-27
Quote from: Moru on 2010-Jul-27
How about numpad then?
No keys on the numpad are detected, except *,-, +
Title: Re: INKEY$ not recognizing some keys
Post by: BasicMe on 2010-Jul-28
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.   :-[
Title: Re: INKEY$ not recognizing some keys
Post by: Moru on 2010-Jul-28
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.