obj.Set("shiftKey", static_cast<bool>(modifiers & ui::EF_SHIFT_DOWN));
obj.Set("ctrlKey", static_cast<bool>(modifiers & ui::EF_CONTROL_DOWN));
obj.Set("altKey", static_cast<bool>(modifiers & ui::EF_ALT_DOWN));
+ obj.Set("metaKey", static_cast<bool>(modifiers & ui::EF_COMMAND_DOWN));
return obj.GetHandle();
}
#include "atom/browser/ui/win/notify_icon_host.h"
#include <commctrl.h>
+#include <winuser.h>
#include "atom/browser/ui/win/notify_icon.h"
#include "base/bind.h"
const wchar_t kNotifyIconHostWindowClass[] = L"Electron_NotifyIconHostWindow";
+bool IsWinPressed() {
+ return ((::GetKeyState(VK_LWIN) & 0x8000) == 0x8000) ||
+ ((::GetKeyState(VK_RWIN) & 0x8000) == 0x8000);
+}
+
int GetKeyboardModifers() {
int modifiers = ui::EF_NONE;
if (base::win::IsShiftPressed())
modifiers |= ui::EF_CONTROL_DOWN;
if (base::win::IsAltPressed())
modifiers |= ui::EF_ALT_DOWN;
+ if (IsWinPressed())
+ modifiers |= ui::EF_COMMAND_DOWN;
return modifiers;
}
* `altKey` Boolean
* `shiftKey` Boolean
* `ctrlKey` Boolean
+ * `metaKey` Boolean
* `bounds` Object - the bounds of tray icon
* `x` Integer
* `y` Integer
* `altKey` Boolean
* `shiftKey` Boolean
* `ctrlKey` Boolean
+ * `metaKey` Boolean
* `bounds` Object - the bounds of tray icon
* `x` Integer
* `y` Integer
* `altKey` Boolean
* `shiftKey` Boolean
* `ctrlKey` Boolean
+ * `metaKey` Boolean
* `bounds` Object - the bounds of tray icon
* `x` Integer
* `y` Integer