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 #include "win8/metro_driver/stdafx.h" | 5 #include "win8/metro_driver/stdafx.h" |
6 #include "win8/metro_driver/chrome_app_view_ash.h" | 6 #include "win8/metro_driver/chrome_app_view_ash.h" |
7 | 7 |
8 #include <corewindow.h> | 8 #include <corewindow.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <windows.foundation.h> | 10 #include <windows.foundation.h> |
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 unsigned int char_code = 0; | 1260 unsigned int char_code = 0; |
1261 HRESULT hr = args->get_KeyCode(&char_code); | 1261 HRESULT hr = args->get_KeyCode(&char_code); |
1262 if (FAILED(hr)) | 1262 if (FAILED(hr)) |
1263 return hr; | 1263 return hr; |
1264 | 1264 |
1265 winui::Core::CorePhysicalKeyStatus status; | 1265 winui::Core::CorePhysicalKeyStatus status; |
1266 hr = args->get_KeyStatus(&status); | 1266 hr = args->get_KeyStatus(&status); |
1267 if (FAILED(hr)) | 1267 if (FAILED(hr)) |
1268 return hr; | 1268 return hr; |
1269 | 1269 |
1270 ui_channel_->Send(new MetroViewerHostMsg_Character(char_code, | 1270 if (status.WasKeyDown) { |
1271 status.RepeatCount, | 1271 ui_channel_->Send(new MetroViewerHostMsg_CharacterForNextKeyEvent( |
1272 status.ScanCode, | 1272 char_code, status.RepeatCount, status.ScanCode, |
1273 GetKeyboardEventFlags())); | 1273 GetKeyboardEventFlags())); |
| 1274 } else { |
| 1275 ui_channel_->Send(new MetroViewerHostMsg_Character( |
| 1276 char_code, status.RepeatCount, status.ScanCode, |
| 1277 GetKeyboardEventFlags())); |
| 1278 } |
1274 return S_OK; | 1279 return S_OK; |
1275 } | 1280 } |
1276 | 1281 |
1277 HRESULT ChromeAppViewAsh::OnWindowActivated( | 1282 HRESULT ChromeAppViewAsh::OnWindowActivated( |
1278 winui::Core::ICoreWindow* sender, | 1283 winui::Core::ICoreWindow* sender, |
1279 winui::Core::IWindowActivatedEventArgs* args) { | 1284 winui::Core::IWindowActivatedEventArgs* args) { |
1280 if (!ui_channel_) | 1285 if (!ui_channel_) |
1281 return S_OK; | 1286 return S_OK; |
1282 | 1287 |
1283 if (args) { | 1288 if (args) { |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1460 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; | 1465 mswr::ComPtr<winapp::Core::ICoreApplicationExit> app_exit; |
1461 CheckHR(core_app.As(&app_exit)); | 1466 CheckHR(core_app.As(&app_exit)); |
1462 globals.app_exit = app_exit.Detach(); | 1467 globals.app_exit = app_exit.Detach(); |
1463 } | 1468 } |
1464 | 1469 |
1465 IFACEMETHODIMP | 1470 IFACEMETHODIMP |
1466 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { | 1471 ChromeAppViewFactory::CreateView(winapp::Core::IFrameworkView** view) { |
1467 *view = mswr::Make<ChromeAppViewAsh>().Detach(); | 1472 *view = mswr::Make<ChromeAppViewAsh>().Detach(); |
1468 return (*view) ? S_OK : E_OUTOFMEMORY; | 1473 return (*view) ? S_OK : E_OUTOFMEMORY; |
1469 } | 1474 } |
OLD | NEW |