MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / ProcessClipboardCommands

Function ProcessClipboardCommands

source/Debugger/Debugger_Win32.cpp:528–579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528void 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}

Callers 1

DebuggerInputConsoleCharFunction · 0.85

Calls 3

DebuggerProcessCommandFunction · 0.85
ConsoleInputCharFunction · 0.85
UpdateDisplayFunction · 0.85

Tested by

no test coverage detected