Fix mouse buttons not working in menus with alwaysgrabmouse on
This commit fixes #1257 (closed) by reintroducing something left out in commit 9f116c7c. From my testing, it looks look the behavior is the exact same regarding the lua hook script that the original commit was fixing (#879 (closed)).
Here is a video showcasing mouse input working + the lua script behaving as it should both with alwaysgrabmouse on and off: