Mac only: added 'isCommand' in nsInputEvent

This commit is contained in:
pierre%netscape.com 1999-01-21 09:52:07 +00:00
Родитель 9217bf329b
Коммит 3a4a6cba6f
2 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -106,6 +106,12 @@ struct nsInputEvent : public nsGUIEvent {
PRBool isControl; PRBool isControl;
/// PR_TRUE indicates the alt key in down /// PR_TRUE indicates the alt key in down
PRBool isAlt; PRBool isAlt;
#ifdef XP_MAC
/// PR_TRUE indicates the command key in down
/// For now, it's only used in Widget: not for export
/// in nsIDOMEvent.h or nsJSEvent.cpp (later maybe)
PRBool isCommand;
#endif
}; };
/** /**

Просмотреть файл

@ -199,6 +199,7 @@ PRBool nsMacEventHandler::HandleKeyEvent(EventRecord& aOSEvent)
keyEvent.isShift = ((aOSEvent.modifiers & shiftKey) != 0); keyEvent.isShift = ((aOSEvent.modifiers & shiftKey) != 0);
keyEvent.isControl = ((aOSEvent.modifiers & controlKey) != 0); keyEvent.isControl = ((aOSEvent.modifiers & controlKey) != 0);
keyEvent.isAlt = ((aOSEvent.modifiers & optionKey) != 0); keyEvent.isAlt = ((aOSEvent.modifiers & optionKey) != 0);
keyEvent.isCommand = ((aOSEvent.modifiers & cmdKey) != 0);
// nsKeyEvent // nsKeyEvent
keyEvent.keyCode = (aOSEvent.message & charCodeMask); //¥TODO: do special keys conversions for NS_VK_F1 etc... keyEvent.keyCode = (aOSEvent.message & charCodeMask); //¥TODO: do special keys conversions for NS_VK_F1 etc...