Just in case anyone has the same issue. Put this in settings.cfg to map Quit to f10 for example.

input.1.keyboard.0.button.68F10=SPC_QUIT.0

Depending on how your keyboard is numbered in the emulator you can change it to input.1.keyboard.1.button.68F10=SPC_QUIT.0 etc. or have multiple lines with just the number after keyboard.(some number) changed.