| 526 | } |
| 527 | |
| 528 | void ProcessClipboardCommands() |
| 529 | { |
| 530 | // Support Clipboard (paste) |
| 531 | if (!IsClipboardFormatAvailable(CF_TEXT)) |
| 532 | return; |
| 533 | |
| 534 | if (!OpenClipboard(GetFrame().g_hFrameWindow)) |
| 535 | return; |
| 536 | |
| 537 | HGLOBAL hClipboard; |
| 538 | LPTSTR pData; |
| 539 | |
| 540 | hClipboard = GetClipboardData(CF_TEXT); |
| 541 | if (hClipboard != NULL) |
| 542 | { |
| 543 | pData = (char*)GlobalLock(hClipboard); |
| 544 | if (pData != NULL) |
| 545 | { |
| 546 | LPTSTR pSrc = pData; |
| 547 | char c; |
| 548 | |
| 549 | while (true) |
| 550 | { |
| 551 | c = *pSrc++; |
| 552 | |
| 553 | if (!c) |
| 554 | break; |
| 555 | |
| 556 | if (c == CHAR_CR) |
| 557 | { |
| 558 | // Eat char |
| 559 | } |
| 560 | else |
| 561 | if (c == CHAR_LF) |
| 562 | { |
| 563 | DebuggerProcessCommand(true); |
| 564 | } |
| 565 | else |
| 566 | { |
| 567 | // If we didn't want verbatim, we could do: |
| 568 | // DebuggerInputConsoleChar( c ); |
| 569 | if ((c >= CHAR_SPACE) && (c <= 126)) // HACK MAGIC # 32 -> ' ', # 126 |
| 570 | ConsoleInputChar(c); |
| 571 | } |
| 572 | } |
| 573 | GlobalUnlock(hClipboard); |
| 574 | } |
| 575 | } |
| 576 | CloseClipboard(); |
| 577 | |
| 578 | UpdateDisplay(UPDATE_CONSOLE_DISPLAY); |
| 579 | } |
no test coverage detected