Thursday, November 5, 2009

Keyboard stuff

Today I finally added keyboard support to CD-i Emulator, in preparation for the upcoming v0.5.3 release.

You can now use the arrow keys and the numeric keypad for movement (the latter allows diagonal movement as well). The default movement rate is 4 (high-resolution) pixels per frame, but you can modify this with the new "keydelta" option.

You can use Space bar and both Enter keys for button 1 and the Shift and numeric keypad "+" keys for button 2; the numeric keypad "-" key acts as button 3 (both buttons simultaneously). I'm not sure yet if the numeric keypad button assignments aren't too easy to hit accidentally.

Internally this is all implemented with a full key mapping but there is currently no UI for changing the mapping.

I've tested a few games and it seems to work okay; compat testing will learn if the default keydelta is right. It might also be necessary to delay the movement actions until the keys have been pressed for a few frames; right now you need to do a VERY quick keypress to get a single delta movement. Or possibly a multistage delta array so that movement accelerates if you press the keys longer.

I've also added automatic Windows cursor hiding, the thing becomes annoying if you're not using it. You can regain the Windows cursor by pressing the Ctrl key, which now also temporarily disables the "cursor grabbing" done by CD-i Emulator (previously this could only be done by pressing Alt or F10 which also paused the emulation).

No comments:

Post a Comment