OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "ui/events/keycodes/keyboard_code_conversion_mac.h" | 5 #import "ui/events/keycodes/keyboard_code_conversion_mac.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #import <Carbon/Carbon.h> | 9 #import <Carbon/Carbon.h> |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 { VKEY_HOME /* 0x24 */, kVK_Home, NSHomeFunctionKey }, | 59 { VKEY_HOME /* 0x24 */, kVK_Home, NSHomeFunctionKey }, |
60 { VKEY_LEFT /* 0x25 */, kVK_LeftArrow, NSLeftArrowFunctionKey }, | 60 { VKEY_LEFT /* 0x25 */, kVK_LeftArrow, NSLeftArrowFunctionKey }, |
61 { VKEY_UP /* 0x26 */, kVK_UpArrow, NSUpArrowFunctionKey }, | 61 { VKEY_UP /* 0x26 */, kVK_UpArrow, NSUpArrowFunctionKey }, |
62 { VKEY_RIGHT /* 0x27 */, kVK_RightArrow, NSRightArrowFunctionKey }, | 62 { VKEY_RIGHT /* 0x27 */, kVK_RightArrow, NSRightArrowFunctionKey }, |
63 { VKEY_DOWN /* 0x28 */, kVK_DownArrow, NSDownArrowFunctionKey }, | 63 { VKEY_DOWN /* 0x28 */, kVK_DownArrow, NSDownArrowFunctionKey }, |
64 { VKEY_SELECT /* 0x29 */, -1, 0 }, | 64 { VKEY_SELECT /* 0x29 */, -1, 0 }, |
65 { VKEY_PRINT /* 0x2A */, -1, NSPrintFunctionKey }, | 65 { VKEY_PRINT /* 0x2A */, -1, NSPrintFunctionKey }, |
66 { VKEY_EXECUTE /* 0x2B */, -1, NSExecuteFunctionKey }, | 66 { VKEY_EXECUTE /* 0x2B */, -1, NSExecuteFunctionKey }, |
67 { VKEY_SNAPSHOT /* 0x2C */, -1, NSPrintScreenFunctionKey }, | 67 { VKEY_SNAPSHOT /* 0x2C */, -1, NSPrintScreenFunctionKey }, |
68 { VKEY_INSERT /* 0x2D */, -1, NSInsertFunctionKey }, | 68 { VKEY_INSERT /* 0x2D */, -1, NSInsertFunctionKey }, |
69 { VKEY_DELETE /* 0x2E */, kVK_ForwardDelete, kDeleteCharCode }, | 69 { VKEY_DELETE /* 0x2E */, kVK_ForwardDelete, NSDeleteFunctionKey }, |
70 { VKEY_HELP /* 0x2F */, kVK_Help, kHelpCharCode }, | 70 { VKEY_HELP /* 0x2F */, kVK_Help, kHelpCharCode }, |
71 { VKEY_0 /* 0x30 */, kVK_ANSI_0, '0' }, | 71 { VKEY_0 /* 0x30 */, kVK_ANSI_0, '0' }, |
72 { VKEY_1 /* 0x31 */, kVK_ANSI_1, '1' }, | 72 { VKEY_1 /* 0x31 */, kVK_ANSI_1, '1' }, |
73 { VKEY_2 /* 0x32 */, kVK_ANSI_2, '2' }, | 73 { VKEY_2 /* 0x32 */, kVK_ANSI_2, '2' }, |
74 { VKEY_3 /* 0x33 */, kVK_ANSI_3, '3' }, | 74 { VKEY_3 /* 0x33 */, kVK_ANSI_3, '3' }, |
75 { VKEY_4 /* 0x34 */, kVK_ANSI_4, '4' }, | 75 { VKEY_4 /* 0x34 */, kVK_ANSI_4, '4' }, |
76 { VKEY_5 /* 0x35 */, kVK_ANSI_5, '5' }, | 76 { VKEY_5 /* 0x35 */, kVK_ANSI_5, '5' }, |
77 { VKEY_6 /* 0x36 */, kVK_ANSI_6, '6' }, | 77 { VKEY_6 /* 0x36 */, kVK_ANSI_6, '6' }, |
78 { VKEY_7 /* 0x37 */, kVK_ANSI_7, '7' }, | 78 { VKEY_7 /* 0x37 */, kVK_ANSI_7, '7' }, |
79 { VKEY_8 /* 0x38 */, kVK_ANSI_8, '8' }, | 79 { VKEY_8 /* 0x38 */, kVK_ANSI_8, '8' }, |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 return code; | 543 return code; |
544 } | 544 } |
545 return KeyboardCodeFromKeyCode([event keyCode]); | 545 return KeyboardCodeFromKeyCode([event keyCode]); |
546 } | 546 } |
547 | 547 |
548 DomCode CodeFromNSEvent(NSEvent* event) { | 548 DomCode CodeFromNSEvent(NSEvent* event) { |
549 return ui::KeycodeConverter::NativeKeycodeToDomCode([event keyCode]); | 549 return ui::KeycodeConverter::NativeKeycodeToDomCode([event keyCode]); |
550 } | 550 } |
551 | 551 |
552 } // namespace ui | 552 } // namespace ui |
OLD | NEW |