Skip to content

Commit

Permalink
Set Windows IME status
Browse files Browse the repository at this point in the history
  • Loading branch information
offalynne committed Jun 11, 2024
1 parent af37209 commit 795503d
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions scripts/__input_system_tick/__input_system_tick.gml
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@ function __input_system_tick()
}
}
}

_global.__game_input_allowed = INPUT_ALLOW_OUT_OF_FOCUS || _global.__window_focus;

var _game_input_allowed_previous = _global.__game_input_allowed;

_global.__game_input_allowed = INPUT_ALLOW_OUT_OF_FOCUS || _global.__window_focus;
_global.__overlay_focus = false;

if (_global.__using_steamworks)
Expand All @@ -168,6 +169,23 @@ function __input_system_tick()
}
}

//Set Windows IME availability based on focus loss and regain
//see https://github.com/YoYoGames/GameMaker-Bugs/issues/5524
if (__INPUT_ON_WINDOWS)
{
if (_global.__game_input_allowed != _game_input_allowed_previous)
{
if (_global.__game_input_allowed)
{
keyboard_virtual_hide();
}
else
{
keyboard_virtual_show(kbv_type_default, kbv_returnkey_default, kbv_autocapitalize_none, false);
}
}
}

//Prevent restart thrashing
if ((_global.__current_time - _global.__restart_time) < 1000)
{
Expand Down

0 comments on commit 795503d

Please sign in to comment.