Mouse copy/paste support (Windows)

Here you can discuss the development of patches.

Mouse copy/paste support (Windows)

Postby Wengier » 2014-10-23 @ 17:16

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.

EDIT: For the latest build, please see the latter posts in this thread, or download the Windows binary from: http://bit.ly/12jANWF (or alternatively from http://bit.ly/1laDvGX if you prefer the Windows binary built with MinGW instead of Visual Studio). The Windows binary now also include features such as automatic drive mounting, direct LPT passthrough, APM power off, DBCS and LFN support in addition to mouse copy/paste support.
You do not have the required permissions to view the files attached to this post.
Last edited by Wengier on 2016-10-09 @ 20:42, edited 47 times in total.
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby Dominus » 2014-10-23 @ 17:28

Is the patch attached as well? And is it cross platform?
User avatar
Dominus
DOSBox Moderator
 
Posts: 7283
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Mouse copy/paste support

Postby Wengier » 2014-10-23 @ 17:36

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.
You do not have the required permissions to view the files attached to this post.
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby Dominus » 2014-10-23 @ 18:04

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 ;)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7283
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Mouse copy/paste support

Postby Jorpho » 2014-10-23 @ 20:02

I hear there's also a flavor of vDOS with LFN.
http://sourceforge.net/p/vdos/discussio ... age=2#92ec
User avatar
Jorpho
l33t++
 
Posts: 7043
Joined: 2003-2-14 @ 19:50
Location: Canada

Re: Mouse copy/paste support

Postby truth_deleted » 2014-10-23 @ 20:30

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".
truth_deleted
 

Re: Mouse copy/paste support

Postby Wengier » 2014-10-23 @ 21:12

Jorpho wrote:I hear there's also a flavor of vDOS with LFN.
http://sourceforge.net/p/vdos/discussio ... age=2#92ec


Yes, it was done by me a few days ago.
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby Wengier » 2014-10-23 @ 21:14

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.
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby Wengier » 2014-10-23 @ 21:17

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).
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby truth_deleted » 2014-10-23 @ 21:49

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).
truth_deleted
 

Re: Mouse copy/paste support

Postby Dominus » 2014-10-23 @ 21:59

Another question, is this patch both LFN and mouse copy/paste?
Because it would be nice to keep them seperate ;)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7283
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Mouse copy/paste support

Postby truth_deleted » 2014-10-23 @ 22:03

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.
truth_deleted
 

Re: Mouse copy/paste support

Postby Wengier » 2014-10-23 @ 22:08

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.
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby truth_deleted » 2014-10-23 @ 22:11

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.
truth_deleted
 

Re: Mouse copy/paste support

Postby Wengier » 2014-10-24 @ 00:02

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.
You do not have the required permissions to view the files attached to this post.
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby Wengier » 2014-10-24 @ 00:42

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.
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby truth_deleted » 2014-10-24 @ 01:32

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.
truth_deleted
 

Re: Mouse copy/paste support

Postby Wengier » 2014-10-24 @ 01:47

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.
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby truth_deleted » 2014-10-24 @ 01:51

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/pos ... pic=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 ... oards.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.)
truth_deleted
 

Re: Mouse copy/paste support

Postby truth_deleted » 2014-10-25 @ 04:55

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.
truth_deleted
 

Next

Return to DOSBox Patches

Who is online

Users browsing this forum: No registered users and 1 guest