VOGONS

Common searches


Copying and pasting in DOSBox?

Topic actions

  • This topic is locked. You cannot reply or edit posts.

First post, by lwc

User metadata
Rank Member
Rank
Member

The DOS emulator in Windows has millions of bugs.
Well, who knows it better than us?

But the one thing you can always count on is the ability to copy and paste.
No matter the application, no matter what, if you see it - you can copy text from/to it.

Just like as if it was a native Windows application.

Without that ability, a program can't intercut with anything else.

So how come DOSBox doesn't have this simple yet powerful ability?
Sometimes I want to use a long command that I have in the clipboard in DOSbox and I really wish I could just paste it.
Or sometimes I want to ask something here and post the relevant DOSBox output and it would be so much easier to just mark it and copy it here.

So what do you think?

Reply 3 of 9, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

Pasting INTO DOSBox should not be that difficult to implement. A hook into the keyboard routines/interrupts and feed DOSBox fake keystrokes that way does not sound difficult.

But copying text OF the DOSBox screen will be much more difficult, since you have to keep track of the content of each character 'cell' on the display. If there is a central hook for outputting characters to an emulated text screen, then PERHAPS you could hook into that routine and just stuff all passing characters into a cut'n'paster buffer. May be something like a 75% solution can be achieved that way.

And so far I have totally ignored the issue of non-ASCII characters....

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 5 of 9, by artmaker

User metadata
Rank Newbie
Rank
Newbie

Cool utility found at this link: A DOS clipboard in the file: mclip110.zip

http://adoxa.cjb.net/

It works in Full-Screen DOS Mode both in Windows 98 and my DOSBox emulator that I use in Windows 7 64-bit.

I created a batch file I named Clip-on.bat which just says: Mousclip.exe /W /B4800

I created another batch file I named Clip-off.bat which just says: Mousclip.exe /U to remove it from memory.

With these switches, it loads a TSR in high memory with a Buffer Size of 4800 bytes (80 X 60). The default buffer is only for about half a screen - but by using the switch it can be made much larger. The "W" switch allows me to copy any of my text-mode executable generated data to this clipboard and then paste it into another application {for example into the text editor TED.com) - which I can ONLY do in Windows 98 when I am NOT in full screen mode. Windows 98 and DOS never supported a full screen DOS clipboard, so this should prove to be quite useful.

Also, it is intelligent. If I am using a mouse-supported program (for example, a DOS Word Processor), it does not operate (goes to sleep) because within a mouse-supported program, the select/copy/cut/paste operations are specific to that program. But as soon as I exit the mouse-supported program it wakes up and works as long as the pasting is done in a non-mouse supported program. There is no "cut" operation, and the only way I have found to clear the clipboard (without removing it from memory) is to select a blank space without any text selected. Copy is done with a left-mouse click and drag. Paste is done with a right-mouse click at the cursor location. If you right-click more than once, you will get paste duplication.

There are many other features and switches that I have not explored yet, but just as I am using it, I am well pleased.

It looks as if the URL above might have some other neat utilities for DOS and DOSBox also.

Reply 7 of 9, by abvgd

User metadata
Rank Newbie
Rank
Newbie
artmaker wrote:

Cool utility found at this link: A DOS clipboard in the file: mclip110.zip

I tried MouseClip as well as the alternatives xPC-Mouse and MouseBuf that were mentioned on the download page, however, none of them work in 64-bit Windows. Apparently all of them are DOS utilities from the early '90:s with just a few minor updates since then. Anyone know of similar utilities that are compatible with 64-bit Windows?

Anyway, I had to resort to using a professional macro utility (it's a commercial utility, not sure whether I can "advertize" its services here) in order to define a macro that when triggered by a hotkey types out the clipboard contents in the active window. Works like a charm not only in DOSBox, but also in WinUAE and many other "clipboard-unfriendly" utilities...

Reply 8 of 9, by ADDiCT

User metadata
Rank Oldbie
Rank
Oldbie

RTFM. Twice.

1. DOSBox is primarily a game emulator. It's not supposed to be used for "productive work", so clipboard support is very low on the priorities list, if it's on the list at all. As DOSBox is Open Source, you could probably add the functionality yourself if you really need it, or devise a workaround like abvgd described. All the "text work" you may have to do in DOSBox can be done on the host OS, which is probably much more convenient than doing it in DOS anyway.

2. Slightly OT, but: there's a small executable you run on the Amiga side in WinUAE which will give clipboard support in both directions. That exe has been in UAE and WinUAE forever.