| Index: ui/events/cocoa/events_mac.mm
|
| diff --git a/ui/events/cocoa/events_mac.mm b/ui/events/cocoa/events_mac.mm
|
| index 1d5d2b86c2c741af5eb7c94c41332643032d3b46..b9f010559ef392a0cf732d796760f1548884ee82 100644
|
| --- a/ui/events/cocoa/events_mac.mm
|
| +++ b/ui/events/cocoa/events_mac.mm
|
| @@ -213,6 +213,48 @@ uint32 PlatformKeycodeFromNative(const base::NativeEvent& native_event) {
|
| return native_event.keyCode;
|
| }
|
|
|
| +uint32 WindowsKeycodeFromNative(const base::NativeEvent& native_event) {
|
| + return static_cast<uint32>(KeyboardCodeFromNSEvent(native_event));
|
| +}
|
| +
|
| +uint16 TextFromNative(const base::NativeEvent& native_event) {
|
| + NSString* text = @"";
|
| + if ([native_event type] != NSFlagsChanged)
|
| + text = [native_event characters];
|
| +
|
| + // These exceptions are based on WebInputEventFactoryMac.mm:
|
| + uint32 windows_keycode = WindowsKeycodeFromNative(native_event);
|
| + if (windows_keycode == '\r')
|
| + text = @"\r";
|
| + if ([text isEqualToString:@"\x7F"])
|
| + text = @"\x8";
|
| + if (windows_keycode == 9)
|
| + text = @"\x9";
|
| +
|
| + uint16 return_value;
|
| + [text getCharacters:&return_value];
|
| + return return_value;
|
| +}
|
| +
|
| +uint16 UnmodifiedTextFromNative(const base::NativeEvent& native_event) {
|
| + NSString* text = @"";
|
| + if ([native_event type] != NSFlagsChanged)
|
| + text = [native_event charactersIgnoringModifiers];
|
| +
|
| + // These exceptions are based on WebInputEventFactoryMac.mm:
|
| + uint32 windows_keycode = WindowsKeycodeFromNative(native_event);
|
| + if (windows_keycode == '\r')
|
| + text = @"\r";
|
| + if ([text isEqualToString:@"\x7F"])
|
| + text = @"\x8";
|
| + if (windows_keycode == 9)
|
| + text = @"\x9";
|
| +
|
| + uint16 return_value;
|
| + [text getCharacters:&return_value];
|
| + return return_value;
|
| +}
|
| +
|
| bool IsCharFromNative(const base::NativeEvent& native_event) {
|
| return false;
|
| }
|
|
|