H-uru / Plasma

Cyan Worlds's Plasma game engine
http://h-uru.github.io/Plasma/
GNU General Public License v3.0
202 stars 80 forks source link

[macOS] Caps Lock does not turn on running #1599

Open dpogue opened 1 week ago

dpogue commented 1 week ago

Turning Caps Lock on and off does not affect the movement speed on macOS. Holding Shift to run works fine.

The bit of extra complexity here is detecting the caps lock state on startup, and monitoring for changes to caps lock state while Uru does not have focus, but it seems like Cocoa events provide ways to do that.

colincornaby commented 1 week ago

I'll take a look.

This also reminds me that there is an open question of optionally adopting the Game Controller framework on newer versions - which provides a more sane interface for games to get keyboard input. This would also be required for iOS/visionOS.

We'd need this code path for older macOS versions though. So I'll look at patching this path.

dpogue commented 6 days ago

The fix in #1601 works well enough for me to consider this closed.