Add UInput.ts to your project and just call UInput.***
from anywhere
if (UInput.getKeyDown(KeyCode.SPACE))
console.log('FIRE')
const moveX = UInput.getKeyAxis(KeyCode.ARROW_LEFT, KeyCode.ARROW_RIGHT);
const moveY = UInput.getKeyAxis(KeyCode.ARROW_DOWN, KeyCode.ARROW_UP);