修复 Linux 下使用 Hyprland 时出现的“Invalid scancode 248”和“Invalid mouse button 99”错误。
问题描述
在 Hyprland 中,有时会发送带有 scancode 248 或鼠标按钮 99 的虚假释放事件,这可能发生在工作区切换期间,也可能看似随机出现。Minecraft 无法识别这些并非真实输入,会将其直接传递下去。结果是:按钮失去响应、物品栏被锁定、JEI 搜索框无法输入文本,且日志中充斥着此类错误。
解决方案
WayKeyFix 会在 Minecraft 接收到输入事件之前进行检查,并丢弃那些任何真实键盘或鼠标都无法产生的无效事件。除此之外不做任何更改。
- 零配置,安装即可
- 仅在 Wayland 上运行。在 X11 或 Windows 上无任何操作
- 仅客户端生效
- 不改动游戏逻辑,因此兼容任意模组或整合包
常见问题
这会破坏我的按键绑定吗?
不会。真实的按键按下不受影响。它仅过滤掉不可能出现的值。
服务器端需要安装这个吗?
不需要。仅客户端生效,请安装在你的本地 mods 文件夹中。
这会消耗性能吗?
在 X11 或 Windows 上根本不会运行任何代码。在 Wayland 上,每个事件都会经过两次整数比较,耗时仅为几分之一纳秒。你根本无法察觉。
安装方法
将 jar 文件放入你的 NeoForge 1.21.1 实例的 mods/ 文件夹中。需要 NeoForge 21.1.233 或更高版本。
注意事项
你的日志中可能仍会显示“Invalid scancode 248”。该消息来自 GLFW 本身,是在 mixin 运行之前记录的。消息依然存在,但它曾经导致的输入损坏问题已消失。
许可证
MIT
Fixes "Invalid scancode 248" and "Invalid mouse button 99" on Linux with Hyprland.
The Problem
On Hyprland, sometimes fake release events get sent with scancode 248 or mouse button 99, either during workspace switches or seemingly at random. Minecraft doesn't know these aren't real inputs and passes them straight through. The result: buttons stop responding, your inventory locks up, JEI search boxes won't take text, and your log fills up with these errors.
The Fix
WayKeyFix checks each input event before Minecraft sees it and drops the ones that no real keyboard or mouse could ever produce. Nothing else changes.
- Zero config, just install it
- Only runs on Wayland. On X11 or Windows it does nothing
- Client side only
- Doesn't touch game logic, so it works with any mod or modpack
FAQ
Will this break my keybinds?
No. Real key presses are untouched. It only filters out impossible values.
Do I need this on the server?
No. Client side only, install it in your local mods folder.
Does this cost performance?
On X11 or Windows, nothing runs at all. On Wayland, each event is checked with two integer comparisons, a fraction of a nanosecond. Not something you'll ever notice.
Install
Drop the jar into your NeoForge 1.21.1 instance's mods/ folder. Requires NeoForge 21.1.233 or newer.
Notice
You may still see "Invalid scancode 248" in your log. That message comes from GLFW itself, logged before the mixin runs. The message stays, but the input corruption it used to cause is gone.
License
MIT
评论 0
登录后参与评分
还没有评论,来抢沙发吧