VOGONS

Common searches


Mouse copy/paste support

Topic actions

First post, by Wengier

User metadata
Rank Member
Rank
Member

As some of you already know, I have added Long File Name (LFN) support to DOSBox last month. Both the DOSBox shell commands and many native LFN-aware DOS programs should now be able to use LFN in DOSBox. However, another useful feature that is missing in the original versions of DOSBox is the ability to copy and paste text in DOSBox by mouse. So since yesterday I went further to add mouse copy and paste support to DOSBox. You can now use the right mouse button to select, copy and paste text from and to DOSBox (when the mouse is not locked). The DOS APIs that communicate with the Windows clipboard are now supported too (e.g. you can copy and paste text using 4DOS's clipboard feature via the CLIP: device name).

See the attachment for the binary, along with all required DLLs.

For the latest build, please download the Windows binary from (updated April 2020): dosbox-svn-lfn.zip

Also look at the later pages for recent improvements related to this feature.

The Windows binary now also includes features such as automatic drive mounting, direct LPT passthrough, APM power off, DBCS and LFN support in addition to mouse copy/paste support.

Update: The much-improved clipboard copy/paste feature is now included as part of DOSBox-X, so please check out DOSBox-X for the latest clipboard copy/paste feature.

Last edited by Wengier on 2021-04-02, 02:28. Edited 52 times in total.

Reply 1 of 151, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Is the patch attached as well? And is it cross platform?

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 2 of 151, by Wengier

User metadata
Rank Member
Rank
Member
Dominus wrote:

Is the patch attached as well? And is it cross platform?

The overall diff from the original DOSBox SVN version that it was based is attached. Currently I have no other OSes to test, so the copy/paste feature is probably Windows-only now. But I could probably make it cross-platform too if there are requests.

Attachments

  • Filename
    patch.diff
    File size
    55.22 KiB
    Downloads
    280 downloads
    File license
    Fair use/fair dealing exception

Reply 3 of 151, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Thanks a diff makes more sense when having this in the patches forum (where I'll move it now) 😉
I'm more interested in cross platform stuff, since I'm not on Windows 😉

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 7 of 151, by Wengier

User metadata
Rank Member
Rank
Member
truth5678 wrote:

I think that's Wengier's patch anyways.

Also, these two thread titles could be renamed, such as "Mouse copy/paste support" and remove the "DOSBox LFN with".

The build on this thread contains (optional) LFN feature as well, so I think it may be better to leave the "LFN" part here.

Reply 8 of 151, by Wengier

User metadata
Rank Member
Rank
Member
Dominus wrote:

Thanks a diff makes more sense when having this in the patches forum (where I'll move it now) 😉
I'm more interested in cross platform stuff, since I'm not on Windows 😉

OK, I will try to set up a working development platform on Linux system (which I have never done before, so it might take some time).

Reply 9 of 151, by truth_deleted

User metadata

Are you setting up an internet-wide or a locally installed development system? TheGreatCodeholio setup a github system available via the internet. I believe gulikoza could advise on the github setup.

Edit: alternatively, if you work in windows, then mingw32 with patch/diff may suffice for a while. It would be a simple solution (setup in an hour at most).

Reply 10 of 151, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Another question, is this patch both LFN and mouse copy/paste?
Because it would be nice to keep them seperate 😉

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 11 of 151, by truth_deleted

User metadata

Wengier needs a good suggestion for his development system, at least as it interfaces with the community here. He obviously is creating great work on his current system.

The two patches should be definitely separated, at least for testing so he has feedback. I'm currently trying to do that via a proper patch file(s) and then present whether the author wants that format.

Reply 12 of 151, by Wengier

User metadata
Rank Member
Rank
Member
Dominus wrote:

Another question, is this patch both LFN and mouse copy/paste?
Because it would be nice to keep them seperate 😉

This build was based on the DOSBox LFN branch. However, the LFN feature is completely optional and can be turned on/off easily. If I make them completely different branches, it would be harder to maintain and also importantly users (including myself) will not be able to use the two useful features at the same time.

However, I can make the patches separate of course. The patches and builds themselves may not be necessarily the same. The former is more for developers, and the later is more for users.

Last edited by Wengier on 2014-10-23, 22:11. Edited 1 time in total.

Reply 13 of 151, by truth_deleted

User metadata

That's a fine idea for a github system (creating a branch of dosbox), but in the patches forum it should be by feature. You can do both, create a dosbox branch on a system like github and then post each feature as a patch on the patch forum here at vogons. Codeholio just does github, probably because he would require a new forum for all the features.

Reply 14 of 151, by Wengier

User metadata
Rank Member
Rank
Member

As promised earlier, I have made a diff as an individual patch for the current mouse copy/paste feature. I will update it again when I make it cross-platform.

Attachments

  • Filename
    patch.diff
    File size
    4.75 KiB
    Downloads
    223 downloads
    File license
    Fair use/fair dealing exception

Reply 15 of 151, by Wengier

User metadata
Rank Member
Rank
Member
truth5678 wrote:

Are you setting up an internet-wide or a locally installed development system? TheGreatCodeholio setup a github system available via the internet. I believe gulikoza could advise on the github setup.

Edit: alternatively, if you work in windows, then mingw32 with patch/diff may suffice for a while. It would be a simple solution (setup in an hour at most).

Thanks for the info. I tried cygwin earlier, but could not get the actual compiler to work properly. mingw32 may be a good solution if it works. The github system may worth a try too.

Reply 16 of 151, by truth_deleted

User metadata

With your coding ability, the compiler will be very easy to setup. I think the easiest (some may disagree) on this procedure, but you may leave out the steps for libogg, libvorbis, and sdl_sound (including this portion of the configure line -- LIBS="-logg -lvorbis -lvorbisfile") : http://www.si-gamer.net/truth/index.html#Building. The major step is the first one, downloading mingw-get-setup.exe and selecting the following packages: msys-base, mingw-developer-toolkit, mingw32-base, mingw32-gcc-g++, mingw32-pthreads-w32. The diff/patch tool should be included, but git and other source code tools are available for mingw. You may grow out of this environment quickly, but it allows for decent productivity. 😀

This setup will allow for windows use while having a lot of cross-platform capability because the tools are very similar between linux and mingw. This setup should also be a couple of steps away from building a github capable environment.

Reply 17 of 151, by Wengier

User metadata
Rank Member
Rank
Member
truth5678 wrote:

With your coding ability, the compiler will be very easy to setup. I think the easiest (some may disagree) on this procedure, but you may leave out the steps for libogg, libvorbis, and sdl_sound (including this portion of the configure line -- LIBS="-logg -lvorbis -lvorbisfile") : http://www.si-gamer.net/truth/index.html#Building. The major step is the first one, downloading mingw-get-setup.exe and selecting the following packages: msys-base, mingw-developer-toolkit, mingw32-base, mingw32-gcc-g++, mingw32-pthreads-w32. The diff/patch tool should be included, but git and other source code tools are available for mingw. You may grow out of this environment quickly, but it allows for decent productivity. 😀

This setup will allow for windows use while having a lot of cross-platform capability because the tools are very similar between linux and mingw. This setup should also be a couple of steps away from building a github capable environment.

Yeah, the compiler is already done on a actual VMware-emulated Fedora 20 system by now (note that in my earlier post I did not mean that the cygwin compiler could not be setup, but that it failed to compile the DOSBox source due to issues with dependencies; but the issue does not exist now with the Fedora 20 system. Yet thanks for your post anyway). I am currently searching on info about clipboard on Linux, but I have got the impression that clipboard support on Linux (for C/C++ at least) is a mess. So I think it may take some work to do it.

Reply 18 of 151, by truth_deleted

User metadata

Great! For the linux diff tool, please try this: diff -rupN dosbox-ORIG/ dosbox-CHANGED/ > patch.diff. This will enforce the patch format where running the diff tool. There may be a lot of extra lines, but this is at least a guide to creating a patch file, and even others can parse for the relevant code if needed.

I haven't looked at clipboard support, but I wonder if SDL has that capability? I can look into it further, if you like. I'm currently looking forward to testing the lfn patch.

Edit: verified that SDL 1.2 doesn't have clipboard support, so you must have used windows api. 😀

http://www.blitzbasic.com/Community/posts.php?topic=101998 (I think this has an OSX code example)

It may be worthwhile to experiment with Gnome first (or another window manager with Fedora 20): https://developer.gnome.org/gtk2/stable/gtk2-Clipboards.html. It may be simpler to port your windows clipboard code that way, and then expand it as people request? (The win32 dosbox binary should run under wine in the case a linux user requires an immediate solution to clipboard access.)

Reply 19 of 151, by truth_deleted

User metadata

I've been testing your patch, it works real well. I noted that the clipboard will accept a long line of text, but dosbox itself will only paste 15 characters of any line of text. I presume this limit is "nearby" to the function "BIOS_AddKeyToBuffer", but I've yet to find the exact cause of the 15 character limit.