mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 17:23:59 +00:00
Don't try to get a key code from event character when there are no characters. Eliminates many "GetGeckoKeyCodeFromChar" warnings printed to console. b=485578 sr=roc
This commit is contained in:
parent
9c5052b1c6
commit
84e62061c8
@ -4331,9 +4331,6 @@ static PRUint32 ConvertMacToGeckoKeyCode(UInt32 keyCode, nsKeyEvent* aKeyEvent,
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
||||
|
||||
PRUint32 geckoKeyCode = 0;
|
||||
PRUnichar charCode = 0;
|
||||
if ([characters length])
|
||||
charCode = [characters characterAtIndex:0];
|
||||
|
||||
switch (keyCode)
|
||||
{
|
||||
@ -4415,7 +4412,8 @@ static PRUint32 ConvertMacToGeckoKeyCode(UInt32 keyCode, nsKeyEvent* aKeyEvent,
|
||||
|
||||
default:
|
||||
// if we haven't gotten the key code already, look at the char code
|
||||
geckoKeyCode = GetGeckoKeyCodeFromChar(charCode);
|
||||
if ([characters length])
|
||||
geckoKeyCode = GetGeckoKeyCodeFromChar([characters characterAtIndex:0]);
|
||||
}
|
||||
|
||||
return geckoKeyCode;
|
||||
|
Loading…
Reference in New Issue
Block a user