Hacker News new | ask | show | jobs
by throwaway3699 1884 days ago
> The key bindings are understandable to me because nowhere in Windows does it let me set IJKL as my WASD. But I know it's possible to get the primary and secondary mouse button config from the OS but some games ignore or are ignorant of this fact.

I'll chip in. As a developer, Unity and Unreal don't really expose that information, and generally devs will not fetch it on their own because that requires dealing with linking to Windows libraries, rather than letting the platform deal with that. Using Windows specific libraries seems like an anti-pattern with Unity too, because now your game is no longer cross platform.

2 comments

You'd think that rather than getting low-level events for "LMB Click" / "RMB Click", the Windows DirectInput API would be handing Unity events for "Primary Mouse Button Click" / "Secondary Mouse Button Click." OSes don't emit raw un-keymapped keysyms to apps, so why are they emitting raw un-mapped mouse-syms?
Unity APIs have always been an incomplete mess.

Big sprawling projects will do it themselves, with a proper action dispatch pattern somewhere, and small indie projects will do it the basic way, like so:

https://docs.unity3d.com/ScriptReference/Input.GetMouseButto...

Meanwhile Unity has tried releasing several different input management solutions, none of which are particularly popular. With more exotic stuff like XR/VR or Steam Input it's even more of a mess.

Time to either lobby for Unity and Unreal to implement it, or to use something better.