Bug in INKEY$

Windows specific questions.
BasicJan
Posts: 46
Joined: Aug 30, 2005 20:09
Location: Netherlands

Bug in INKEY$

Postby BasicJan » Oct 11, 2005 20:08

If a diacritical character is entered using <ALT><ASCII-value> INKEY$ not only responds if the <ALT>-key is released, but also when each of the digits is entered. The entered digit is represented as an extended key.

Try next program:

SCREEN 17
CLS

Contin$="Y"
DO WHILE Contin$="Y"

Kbd$=""
DO WHILE Kbd$=""
Kbd$=INKEY$
LOOP

SELECT CASE Kbd$
CASE CHR$(32) TO CHR$(254)
PRINT "Regular:";Kbd$
Contin$="N"
CASE CHR$(255)+CHR$(32) TO CHR$(255)+CHR$(254)
PRINT "Extended: ";Kbd$
CASE ELSE
PRINT "Hello "; Kbd$
END SELECT

LOOP

INPUT "Stop";A$

This differs from QuickBasic, where only the 'full' character is responded.

(FreeBasic 0.15, GUI)
mjs
Site Admin
Posts: 842
Joined: Jun 16, 2005 19:50
Location: Germany

Postby mjs » Oct 11, 2005 20:43

This is a feature, not a bug.

EDIT: After thinking a bit about this, I realized that this feature may cause problems in old applications and therefore needs to be disabled. The changes are in CVS now.
BTW: In console mode, ALT+NumKeys only work when NUM-LOCK is ON. However, it'll work as expected in graphics mode.

Regards,
Mark
BasicJan
Posts: 46
Joined: Aug 30, 2005 20:09
Location: Netherlands

Postby BasicJan » Oct 12, 2005 16:55

The compatibility in old QuickBasic-programs is the reason why I noticed this.

Thanks for fixing.

Jan
Fausti
Posts: 32
Joined: Sep 26, 2005 21:33

Postby Fausti » Nov 09, 2005 11:02

Ok, as the thread title is fitting my question:

There seems to be a bug in the oct-22 testing release of fb for windumb. Try this code:

Code: Select all

Screen 12

While Inkey$ <> Chr$(27): Wend


After pressing a key for ca. 10 seconds, it will crash. It first occurs in a longer program where I've done a lot of calculations. So I first thought it was my fault, some misusing of a pointer, perhaps.

But yesterday I compiled a code from joe kings raycaster tutorial and the error occured again. Than I've written this short code to test my theory of a bug. It occured again.

It wasn't crashing with the 0.14 release under windumb and under linux even works with 0.14 till 0.15-oct-22. So it seems to be really a windumb issue. And it seems to be inkey$ related and not happening in console mode at all.

Perhaps you would need this peace of info (windows version specific?):
Windows MCE, Athlon Semperon 2200+, 512MB
mjs
Site Admin
Posts: 842
Joined: Jun 16, 2005 19:50
Location: Germany

Postby mjs » Nov 09, 2005 12:06

Will be fixed in the next release, it's already fixed in CVS.

Regards,
Mark

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 3 guests