Keyboard game → controller in ~20 lines

The game below only reads the keyboard. About 20 lines of bridge code press its keys from a controller and add haptics.

← → or left stick: move · Space, R2 or the bottom face button: fire No controller · press any button on one