Window manager unresponsive after pressing hardware back/forward buttons

I have a Lenovo x220 running latest manjaro KDE. I have shifted from using KDE full desktop enviroment to using only a window manager such as awesomewm, bspwm, dwm. I have set up my window managers and they each seem to work fine except for one issue. If I press the hardware back and forward buttons to navigate, the whole desktop environment becomes unresponsive. At first the keys seem to be working fine, it will go backwards or forward in a browser/file manager etc as expected. But another issue becomes obvious as soon as I try to do something else. The current window keeps receiving keyboard input but the mouse and any activities outside of the current window cease functioning (I can still move the mouse but clicks don’t work properly). The only solution I have found is to kill Xorg from another tty then restart it. These buttons work without issue in KDE. Does anyone know what could be causing this/how to fix it?

Maybe there is a keybinding for these buttons (I guess it’s the mouse?). Which WM are you using? All of the ones you mentioned are behaving this way?

It happens in all three of them, though I usually use awesomewm. The button is a physical button built into the laptop keyboard.

You need to find out what code is being used for that button;

The key codes are

166 XF86Back
167 XF86Forward

They report just like any other key using xev so I’m still unsure why this causes the WM to stop responding.

I set up a test binding in sxhkd to see if it is able to receive any input after this issue has been triggered, and it does not seem to fire. I have eliminated sxhkd itself as a candidate for the cause as the issue persists regardless of whether or not the daemon is running.