Skip to content

Commit cca0492

Browse files
committed
Fixed #8959 (onClientKey/Character tweaks)
1 parent 599234d commit cca0492

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

MTA10/mods/deathmatch/logic/CClientGame.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2331,7 +2331,9 @@ bool CClientGame::KeyStrokeHandler ( const SString& strKey, bool bState, bool bI
23312331
bool bIgnore = false;
23322332
if ( bState )
23332333
{
2334-
if ( g_pCore->IsMenuVisible() || ( g_pCore->GetConsole()->IsInputActive() && bIsConsoleInputKey ) )
2334+
auto pFocusedBrowser = g_pCore->GetWebCore ()->GetFocusedWebView ();
2335+
2336+
if ( g_pCore->IsMenuVisible() || ( g_pCore->GetConsole()->IsInputActive() && bIsConsoleInputKey ) || ( pFocusedBrowser && !pFocusedBrowser->IsLocal () ) )
23352337
bIgnore = true; // Ignore this keydown and the matching keyup
23362338
else
23372339
MapInsert( m_AllowKeyUpMap, strKey ); // Use this keydown and the matching keyup
@@ -2387,6 +2389,11 @@ bool CClientGame::CharacterKeyHandler ( WPARAM wChar )
23872389
// Do we have a root yet?
23882390
if ( m_pRootEntity && g_pCore->IsMenuVisible() == false && g_pCore->GetConsole()->IsInputActive() == false )
23892391
{
2392+
// Cancel event if remote browser is focused
2393+
auto pFocusedBrowser = g_pCore->GetWebCore ()->GetFocusedWebView ();
2394+
if ( pFocusedBrowser && !pFocusedBrowser->IsLocal () )
2395+
return false;
2396+
23902397
// Safe character?
23912398
if ( wChar >= 32 )
23922399
{

0 commit comments

Comments
 (0)