Chromium Code Reviews| Index: trunk/src/views/win/SkOSWindow_win.cpp |
| =================================================================== |
| --- trunk/src/views/win/SkOSWindow_win.cpp (revision 8166) |
| +++ trunk/src/views/win/SkOSWindow_win.cpp (working copy) |
| @@ -104,7 +104,23 @@ |
| } |
| static unsigned getModifiers(UINT message) { |
| - return 0; // TODO |
| + static const struct { |
|
bungeman-skia
2013/03/15 16:12:44
Not sure what this has to do with this change, but
reed1
2013/03/15 17:46:44
Accidentally picked up when I editing on my win ma
|
| + int fVKey; |
| + unsigned fSkMask; |
| + } gModi[] = { |
| + { VK_SHIFT, kShift_SkModifierKey }, |
| + { VK_CONTROL, kControl_SkModifierKey }, |
| + { VK_MENU, kOption_SkModifierKey }, |
| + }; |
| + |
| + unsigned modi = 0; |
| + for (size_t i = 0; i < SK_ARRAY_COUNT(gModi); ++i) { |
| + // check the high-bit of the returned ushort |
| + if (GetKeyState(gModi[i].fVKey) & 0x8000) { |
| + modi |= gModi[i].fSkMask; |
| + } |
| + } |
| + return modi; |
| } |
| bool SkOSWindow::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { |