Hyprland Input Fix
Fixes broken GUI interactions and GL errors when running Minecraft on Hyprland (Wayland).
介绍
Hyprland Input Fix
Finally play Minecraft smoothly on Hyprland!
Fix frustrating input bugs that make GUI interactions impossible after switching workspaces on Hyprland (Wayland).
Does This Sound Familiar?
You’re playing Minecraft on Linux with Hyprland, you switch to another workspace to check Discord or your browser, then when you come back:
- Can’t click anything in Minecraft – menus, inventory, buttons all broken
- Logs filled with errors:
GL ERROR: Invalid scancode 248andInvalid mouse button 99 - The only fix: Press a keyboard key
This mod fixes it completely, no need to move your hand to your keyboard every time you switch workspaces.
What This Mod Does
This lightweight client-side mod sits between Hyprland and Minecraft, catching and filtering out the invalid input events that break your game.
Before Installing:
[Switch workspace -> Return to Minecraft]
X Can't click inventory
X Can't open menus
X Spam of GL errors in console
? Press random keys to "unstick" input
After Installing:
[Switch workspace -> Return to Minecraft]
✓ Everything just works
✓ Click anything immediately
✓ No errors, no workarounds needed
Features
| Feature | Description |
|---|---|
| Fix Mouse Input | Filters invalid mouse button events (button 99 → blocked) |
| Fix Keyboard Input | Filters invalid scancode events (scancode 248 → blocked) |
| Zero Config | Install and forget – works automatically |
| No Performance Hit | Lightweight mixin implementation |
| Client-Side Only | No server installation needed |
| Safe & Non-Intrusive | Only blocks invalid events, normal input unaffected |
Compatibility
| Minecraft | 1.20.1 |
| Mod Loader | Forge 47.2.0+ |
| Side | Client Only |
| Environment | Hyprland on Wayland (Linux) |
Works with all modpacks! This mod only touches input validation and is compatible with everything.
Technical Details
Click to expand technical explanation
The Problem
When you switch Hyprland workspaces, the compositor sends “release all keys/buttons” events to prevent stuck inputs. However, it sometimes sends events with invalid GLFW codes:
- Mouse button 99 (valid range: 0-7)
- Scancode 248 (valid range: 0-200)
Minecraft’s GLFW integration doesn’t validate these and they corrupt the internal input state, making GUIs unclickable.
The Solution
This mod uses Mixin to inject validation at the start of:
MouseHandler.onPress()– Validates mouse button rangeKeyboardHandler.keyPress()– Validates scancode range
Invalid events are cancelled at HEAD before Minecraft processes them, keeping input state clean.
FAQ
Do I need this mod if I don’t use Hyprland?
No, but it won’t hurt anything. The mod only filters genuinely invalid input codes that would cause errors anyway.
Will this work on other Wayland compositors?
Possibly! If you experience similar issues on Sway, River, or other compositors, give it a try.
Does this affect normal gameplay?
Not at all. Valid inputs pass through unchanged – this only blocks invalid codes that would crash or corrupt input handling.
Can I use this on a server?
No need! This is client-side only. Input handling happens on your computer, not the server.
Will this slow down my game?
No. The validation check is trivial (two integer comparisons) and runs only on input events.
常见问题
Hyprland Input Fix 支持哪些 Minecraft 版本?
Hyprland Input Fix 支持 Minecraft Java 版 1.20.1,可用的加载器:Forge。下载时注意选择和你游戏版本一致的文件。
Hyprland Input Fix 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Forge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
TysonTheEmber 的其他作品
查看全部 →Wither: Reincarnated
一款强化了 Minecraft 中表现平平的凋灵 Boss 的模组
Embers Text API
可以随意使用炫酷的文字效果,包括自定义字体!
Orbital Railgun Reforged
用轨道打击摧毁你的敌人!
Spelunkery+
一个为 Spelunkery 添加兼容性的附属模组!
评论
登录后评论和评分