]> khamidou — GitHub mirrors - electron.git/commitdiff
win: Fix the key code of Alt.
authorCheng Zhao <zcbenz@gmail.com>
Thu, 7 Aug 2014 07:02:27 +0000 (15:02 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 7 Aug 2014 07:02:27 +0000 (15:02 +0800)
atom/browser/native_window_views.cc

index d740af44fbc6a44aab5f85e8554ffc5781b6987a..bf25ea87fa2771530b702499d68b8f5f300bbf8d 100644 (file)
@@ -550,8 +550,12 @@ void NativeWindowViews::HandleKeyboardEvent(
     const content::NativeWebKeyboardEvent& event) {
   if (menu_bar_autohide_ &&
       (event.modifiers & content::NativeWebKeyboardEvent::AltKey) &&
+#if defined(USE_X11)
       // 164 and 165 represent VK_LALT and VK_RALT.
       (event.windowsKeyCode == 164 || event.windowsKeyCode == 165) &&
+#else
+      (event.windowsKeyCode == ui::VKEY_MENU) &&
+#endif
       (event.type == blink::WebInputEvent::RawKeyDown)) {
     SetMenuBarVisibility(!menu_bar_show_);
     Layout();