I wrote a reply but i guess my internet died and it never sent.
Joy2key lets you change behaviour with a time threshold.
that means. Whatever key you map, you can tell it to to something (in your case nothing) or, past 2000 milliseconds, trigger the exit hotkey.
I dunno if you can use joy2key in raspberry pi, but in any case, it might help someone else.