Great Job
I wish I saw it before I entered all the ScanCodes personally!
I am just getting back into Dark Basic after a few years away and it was nice to see some commands I didn't know could be used: User Defined Types, Dynamic Arrays, and equally important: #Constants!
I wanted to comment on your dynamic array implementation. This is a good design because polling all the keys or polling a full array is to time consuming for a main game play loop.
I'm going to borrow the technique and apply it to the user interface functions I'm putting together.
I was searching the forum to see how others were grabbing scancodes etc. because its a fact they are smoother for game play then A$=inkey$() and I figured I definately can't be the first doing this.
The TGC developers knew keystate/scancode polling is smoothest when they added little functions like UPKEY(). These allow multi-key input easily - for the predefined ones they made functions for anyways.
The main difference with how mine is put together is the same principle for snagging "user defined" keys is used to snag user defined ANYTHING, such as the joystick, mouse or the extra "CONTROL DEVICE".
The idea is to map user input to ACTIONS. Then programs will ask the UI what "ACTIONS" have been requested ratheer than what key or whatever. I should hopefulyl be able to implement one of those routines when I'm through where the USER picks what control(s) do what action.
As for your "Key Delay" Enabled, not enabled etc. I plan to implement that sort of thing (Your code is a good tested base) for the ACTIONS versus the keys. So On one hand I'll be collecting What the user did and translating that to an action - then the game logic will translate the action into whatever action is/does etc.
Good Post and code snippet!
Know way to many languages - Master of none