Rev 1 | Rev 21 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 3 | ||
---|---|---|---|
Line 14... | Line 14... | ||
14 | 14 | ||
15 | static wchar_t fen_string[128]; |
15 | static wchar_t fen_string[128]; |
16 | static char selectable_parts[14] = "PRNBQK kqbnrp"; |
16 | static char selectable_parts[14] = "PRNBQK kqbnrp"; |
17 | static int prevgui_x = 0; |
17 | static int prevgui_x = 0; |
18 | static int prevgui_y = 0; |
18 | static int prevgui_y = 0; |
- | 19 | static bool ctrl_pressed = false; |
|
19 | static bool rbutton_pushed = false; |
20 | static bool rbutton_pushed = false; |
20 | 21 | ||
21 | unsigned short wParam_hiword; |
22 | unsigned short wParam_hiword; |
22 | unsigned short wParam_loword; |
23 | unsigned short wParam_loword; |
23 | int prev_hovered_position[2]; |
24 | int prev_hovered_position[2]; |
Line 296... | Line 297... | ||
296 | ShellExecute (NULL, L"open", L"http://www.chessgames.com", NULL, NULL, SW_MAXIMIZE); // fire up the browser |
297 | ShellExecute (NULL, L"open", L"http://www.chessgames.com", NULL, NULL, SW_MAXIMIZE); // fire up the browser |
297 | 298 | ||
298 | // help menu, about |
299 | // help menu, about |
299 | else if (wParam_loword == MENUID_HELP_ABOUT) |
300 | else if (wParam_loword == MENUID_HELP_ABOUT) |
300 | DialogBox_About (); // show the About dialog box |
301 | DialogBox_About (); // show the About dialog box |
- | 302 | ||
- | 303 | // call the default window message processing function to keep things going |
|
- | 304 | return (DefWindowProc (hWnd, message, wParam, lParam)); |
|
- | 305 | } |
|
- | 306 | ||
- | 307 | ///////////////////////////////////////////////////// |
|
- | 308 | // ctrl key press or release (while not in animation) |
|
- | 309 | else if ((message == WM_KEYDOWN) && (wParam == VK_CONTROL) && (animation_endtime + 1.0f < current_time)) |
|
- | 310 | { |
|
- | 311 | ctrl_pressed = true; // remember the ctrl key is pressed |
|
- | 312 | ||
- | 313 | // call the default window message processing function to keep things going |
|
- | 314 | return (DefWindowProc (hWnd, message, wParam, lParam)); |
|
- | 315 | } |
|
- | 316 | else if ((message == WM_KEYUP) && (wParam == VK_CONTROL) && (animation_endtime + 1.0f < current_time)) |
|
- | 317 | { |
|
- | 318 | ctrl_pressed = false; // remember the ctrl key is released |
|
- | 319 | rbutton_pushed = false; // remember button is released |
|
- | 320 | the_scene.update = true; // update the 3D scene |
|
- | 321 | ||
- | 322 | // call the default window message processing function to keep things going |
|
- | 323 | return (DefWindowProc (hWnd, message, wParam, lParam)); |
|
- | 324 | } |
|
- | 325 | ||
- | 326 | //////////////////////////////////////////////////////////////////////////////////////////////// |
|
- | 327 | // left mouse button push (while not in animation) |
|
- | 328 | else if ((message == WM_LBUTTONDOWN) && (animation_endtime + 1.0f < current_time)) |
|
- | 329 | { |
|
- | 330 | // is the ctrl key pressed (emulates a right click) ? |
|
- | 331 | if (ctrl_pressed) |
|
- | 332 | { |
|
- | 333 | prevgui_x = GET_X_LPARAM (lParam); // remember mouse coordinates |
|
- | 334 | prevgui_y = GET_Y_LPARAM (lParam); |
|
- | 335 | ||
- | 336 | // if we click something, stop moving the table immediately |
|
- | 337 | the_board.players[current_viewer].view_pitch = current_pitch; |
|
- | 338 | the_board.players[current_viewer].view_yaw = current_yaw; |
|
- | 339 | ||
- | 340 | rbutton_pushed = true; // remember button is clicked |
|
- | 341 | } |
|
301 | 342 | ||
302 | // call the default window message processing function to keep things going |
343 | // call the default window message processing function to keep things going |
303 | return (DefWindowProc (hWnd, message, wParam, lParam)); |
344 | return (DefWindowProc (hWnd, message, wParam, lParam)); |
304 | } |
345 | } |
305 | 346 | ||
306 | //////////////////////////////////////////////////////////////////////////////////////////////// |
347 | //////////////////////////////////////////////////////////////////////////////////////////////// |
307 | // left mouse button release (while not in animation) |
348 | // left mouse button release (while not in animation) |
308 | else if ((message == WM_LBUTTONUP) && (animation_endtime + 1.0f < current_time)) |
349 | else if ((message == WM_LBUTTONUP) && (animation_endtime + 1.0f < current_time)) |
309 | { |
350 | { |
- | 351 | // is the ctrl key pressed (emulates a right click) ? |
|
- | 352 | if (ctrl_pressed) |
|
- | 353 | { |
|
- | 354 | rbutton_pushed = false; // remember button is released |
|
- | 355 | the_scene.update = true; // update the 3D scene |
|
- | 356 | ||
- | 357 | // call the default window message processing function to keep things going |
|
- | 358 | return (DefWindowProc (hWnd, message, wParam, lParam)); |
|
- | 359 | } |
|
- | 360 | ||
310 | prevgui_x = GET_X_LPARAM (lParam); // remember mouse coordinates |
361 | prevgui_x = GET_X_LPARAM (lParam); // remember mouse coordinates |
311 | prevgui_y = GET_Y_LPARAM (lParam); |
362 | prevgui_y = GET_Y_LPARAM (lParam); |
312 | 363 | ||
313 | // get mouse coordinates |
364 | // get mouse coordinates |
314 | gui_x = GET_X_LPARAM (lParam); |
365 | gui_x = GET_X_LPARAM (lParam); |