Block keyboard in background when running retroarch

please excuse me if this has already been answered elsewhere on the forum, but I couldn’t find anything regarding this issue.

When I run retroarch (my system: Rasperry Pi 3 running arch linux arm) any keyboard presses are picked up not only by retroarch, but also by whatever I have running behind it in X. this is really problematic as when I run retroarch from a terminal the terminal app will continue to receive any keyboard presses while I’m using retroarch.

This is also happens even when not running X.

does anyone else have this issue, and/or is anyone aware of a solution?