Skip to main content

The Power of Pride Bundle 2026 — $10 PWYC Edition
On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Avoid key repeats?

A topic by JavaJack created 10 days ago Views: 18 Replies: 1
Viewing posts 1 to 2

This runs, but when I press a key even very briefly, it tends to register 3 or more times.

@OPTION SYSTEM vic20.orig
CLS
while 1
    dim k as u8
    k = KEY()
    if k <> 0 then print k
endwhile
(+1)

Sorry about that!  I was able to repro this, thank you for the bug report.  It's fixed and will be in the next release (I'm shooting for next week).

For now, to get around that you can do this, which works.  I tested it here with 1.2.0 and xvic.

  K AS U8
  LAST AS U8
  WHILE 1
      K = RAWKEY_CODE
      IF K <> 0 AND LAST = 0 THEN
          PRINT K
      ENDIF
      LAST = K
  ENDWHILE