Grid Sage Forums

Grid Sage Forums

  • November 21, 2024, 03:04:58 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

LINKS: Website | Steam | Wiki

Author Topic: The mouse-killing Keyboard Mode persists through losing window focus  (Read 3223 times)

Maurog

  • Unaware
  • *
  • Participated in the Alpha Challenge 2015 Supported Cogmind Alpha Access 2015 (Advanced Tier!!!)
  • Posts: 13
    • View Profile

Reproduce it by switching to Keyboard Only mode by pressing F2 and then alt-tabbing out of the game.

Your mouse will remain locked even though game window lost focus and you're in the other windows of your operating system.

Expected behavior: Mouse is only locked inside the game, but is unlocked if you switch windows (locked again if you alt-tab back to the game).
Logged
Slay the living! Raise the dead! Paint the sky in crimson red!

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind

What's your OS?

I use keyboard mode all the time and do a lot of alt-tabbing, but I've never had it lock the mouse on me. (I'm on Win7.)

We can resolve this by, as you say, manually making sure the mouse is unlocked on focus switch. Though focus detection in Windows is actually not all that straightforward, so we'll see how well it works... (this is why I didn't implement caps lock detection for text entry, as well--it doesn't play nice with alt-tabbing+SDL, the engine Cogmind runs on).
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Maurog

  • Unaware
  • *
  • Participated in the Alpha Challenge 2015 Supported Cogmind Alpha Access 2015 (Advanced Tier!!!)
  • Posts: 13
    • View Profile

This happens in Windows 7, but I forgot an important detail.

You have to be in full screen mode. Alt-tabbing from full screen mode with the mouse locked will not unlock it. It does release the mouse fine in windowed mode.
Logged
Slay the living! Raise the dead! Paint the sky in crimson red!

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind

Ah, no wonder, I almost always use windowed since that's more convenient for alt-tabbing, and takes up less room ;). Yeah, that's an important detail. I'll look into it.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon