| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "webkit/glue/webinputevent.h" | 7 #include "webkit/glue/webinputevent.h" |
| 8 | 8 |
| 9 #include "webkit/glue/event_conversion.h" | 9 #include "webkit/glue/event_conversion.h" |
| 10 | 10 |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 LPARAM lparam) { | 255 LPARAM lparam) { |
| 256 modifiers = 0; | 256 modifiers = 0; |
| 257 system_key = false; | 257 system_key = false; |
| 258 | 258 |
| 259 actual_message.hwnd = hwnd; | 259 actual_message.hwnd = hwnd; |
| 260 actual_message.message = message; | 260 actual_message.message = message; |
| 261 actual_message.wParam = wparam; | 261 actual_message.wParam = wparam; |
| 262 actual_message.lParam = lparam; | 262 actual_message.lParam = lparam; |
| 263 | 263 |
| 264 key_code = static_cast<int>(wparam); | 264 key_code = static_cast<int>(wparam); |
| 265 key_data = static_cast<int>(lparam); | |
| 266 | 265 |
| 267 switch (message) { | 266 switch (message) { |
| 268 case WM_SYSKEYDOWN: | 267 case WM_SYSKEYDOWN: |
| 269 system_key = true; | 268 system_key = true; |
| 270 case WM_KEYDOWN: | 269 case WM_KEYDOWN: |
| 271 type = KEY_DOWN; | 270 type = KEY_DOWN; |
| 272 break; | 271 break; |
| 273 case WM_SYSKEYUP: | 272 case WM_SYSKEYUP: |
| 274 system_key = true; | 273 system_key = true; |
| 275 case WM_KEYUP: | 274 case WM_KEYUP: |
| 276 type = KEY_UP; | 275 type = KEY_UP; |
| 277 break; | 276 break; |
| 278 case WM_IME_CHAR: | 277 case WM_IME_CHAR: |
| 279 key_data = static_cast<int>(wparam); | |
| 280 type = CHAR; | 278 type = CHAR; |
| 281 break; | 279 break; |
| 282 case WM_SYSCHAR: | 280 case WM_SYSCHAR: |
| 283 system_key = true; | 281 system_key = true; |
| 284 type = CHAR; | 282 type = CHAR; |
| 285 case WM_CHAR: | 283 case WM_CHAR: |
| 286 type = CHAR; | 284 type = CHAR; |
| 287 break; | 285 break; |
| 288 default: | 286 default: |
| 289 NOTREACHED() << "unexpected native message"; | 287 NOTREACHED() << "unexpected native message"; |
| 290 } | 288 } |
| 291 | 289 |
| 292 if (GetKeyState(VK_SHIFT) & 0x8000) | 290 if (GetKeyState(VK_SHIFT) & 0x8000) |
| 293 modifiers |= SHIFT_KEY; | 291 modifiers |= SHIFT_KEY; |
| 294 if (GetKeyState(VK_CONTROL) & 0x8000) | 292 if (GetKeyState(VK_CONTROL) & 0x8000) |
| 295 modifiers |= CTRL_KEY; | 293 modifiers |= CTRL_KEY; |
| 296 if (GetKeyState(VK_MENU) & 0x8000) | 294 if (GetKeyState(VK_MENU) & 0x8000) |
| 297 modifiers |= (ALT_KEY | META_KEY); | 295 modifiers |= (ALT_KEY | META_KEY); |
| 298 | 296 |
| 299 if (LOWORD(lparam) > 1) | 297 if (LOWORD(lparam) > 1) |
| 300 modifiers |= IS_AUTO_REPEAT; | 298 modifiers |= IS_AUTO_REPEAT; |
| 301 | 299 |
| 302 // TODO(darin): figure out if we should set IS_KEYPAD | 300 // TODO(darin): figure out if we should set IS_KEYPAD |
| 303 } | 301 } |
| 304 | 302 |
| OLD | NEW |