INKEY will not recognize Esc or Delete key presses.


Hi Chris,

If you install a keyboard with an Esc key and Delete key, such as the "Keyboard with Ctrl key Settings" for Android, the Esc key and Delete key will not be polled by INKEY. I know certain keys are omitted like Alt, Shift and Ctrl but most BASSIC languages have the Esc and Delete keys polled by INKEY. For instance, in QB, QB64, and other BASIC languages that use INKEY, Alt, Shift, and Ctrl do not return values but chr(27) is returned for Esc and a 2-lentgh chr(0) + chr(127) is returned when the Delete key is pressed. Is it possible to include these keys in the SB INKEY function?

Wow, this is a really fun language. I hope you enjoy developing and supporting SB. I do a lot of text related programming so I really appreciate the INKEY function.



Tested with this code:

while 1
b = inkey
if b <> "" then
select case len(b)
case 1
? b,asc(b)
case 2
? b, asc(mid(b,2,1)), asc(mid(b,2,1))
end select
end if

Hi Pete,

Thanks for your report. I tried "hackers keyboard" and sure enough, ESC and DEL don't seem to register.

I'll attempt to include a fix for this in the next update (hopefully in a few weeks or so)