Mouse copy/paste support (Windows)

Here you can discuss the development of patches.

Re: Mouse copy/paste support

Postby ripsaw8080 » 2014-10-25 @ 09:23

truth5678 wrote: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.

Maybe because the BIOS keyboard buffer can hold a maximum of 16 keystrokes? ;) However, it's possible to install a relatively simple device driver or TSR with a larger buffer that feeds into the BIOS buffer as entries become available, which could be useful when "stuffing" many keystrokes.
User avatar
ripsaw8080
DOSBox Author
 
Posts: 4123
Joined: 2006-4-25 @ 23:24

Re: Mouse copy/paste support

Postby truth_deleted » 2014-10-25 @ 09:38

Thanks for the guidance! I'll try to find a TSR that should work. :)

Edit: and a TSR that expands keyboard buffer to 256 characters, http://cd.textfiles.com/simtel/simtel20 ... 56KEYS.ZIP. Appreciate it!
truth_deleted
 

Re: Mouse copy/paste support

Postby Dominus » 2014-10-25 @ 09:54

Does it work?
User avatar
Dominus
DOSBox Moderator
 
Posts: 7381
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Mouse copy/paste support

Postby truth_deleted » 2014-10-25 @ 09:58

Yes; as ripsaw said, once the buffer is expanded then the paste operation has that expanded limit. That isn't the only utility to expand the keyboard buffer, it was just the first one I tried. Apparently, it's a whole genre of utility programs. :)
Last edited by truth_deleted on 2014-10-25 @ 10:00, edited 1 time in total.
truth_deleted
 

Re: Mouse copy/paste support

Postby Dominus » 2014-10-25 @ 09:59

Great!
User avatar
Dominus
DOSBox Moderator
 
Posts: 7381
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Mouse copy/paste support

Postby Wengier » 2014-10-25 @ 17:34

truth5678 wrote: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.)


Thanks for your message. Sure, I can use the -rupN option from now on for diff.

Regarding clipboard support, the main problem with the above approach is that it would obviously require the inclusion of GTK+ libraries to the branch, which I am not sure if the DOSBox development team would be fine with them. Alternatively, I can use the PDCurses library, which has cross-platform clipboard support too, and is more light-weighted.
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby Dominus » 2014-10-25 @ 17:53

Yes, definitely please, no gtk ;) (though I'm not a dosbox dev).

And please use the different diff options, I'm not able to apply your patches except manually and that is not fun in regard to your long patches ;)

While we tried to apply your patch Emendelson mentioned you took over the right click for your copy/paste function. Maybe consider using a modifier along (e.g. Alt+right click) so to not clash with games that use the right click.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7381
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Mouse copy/paste support

Postby Wengier » 2014-10-25 @ 18:01

Dominus wrote:Yes, definitely please, no gtk ;) (though I'm not a dosbox dev).

And please use the different diff options, I'm not able to apply your patches except manually and that is not fun in regard to your long patches ;)

While we tried to apply your patch Emendelson mentioned you took over the right click for your copy/paste function. Maybe consider using a modifier along (e.g. Alt+right click) so to not clash with games that use the right click.


Glad that I asked. As for the copy/paste function, probably a customizable setting in dosbox.conf will do (e.g. modifier=none, alt, ctrl, etc)?
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby Dominus » 2014-10-25 @ 18:18

That conf setting could work, though the dosbox devs are always very hesistant about config settings.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7381
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Mouse copy/paste support

Postby truth_deleted » 2014-10-25 @ 19:54

An alternative is a dosbox.conf setting for clipboard = on/off.
truth_deleted
 

Re: Mouse copy/paste support

Postby Wengier » 2014-10-25 @ 20:00

truth5678 wrote:An alternative is a dosbox.conf setting for clipboard = on/off.


How about clipboardmodifer=none,alt,alt,lalt,disabled (I have already made it, and I am posting it now, see below).
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby Wengier » 2014-10-25 @ 20:05

OK, I have made the clipboard copy/paste function based on PDCurses, so in theory it should be already cross-platform now. I have also added a setting in dosbox.conf named "clipboardmodifier", which can be set to none, alt, lalt, ralt, and disabled. When setting to none (default), there will be no modifier required. when setting to lalt, or ralt, or alt, then the left ALT, right ALT, or either ALT will be used as the keyboard modifier for the mouse copy/paste function. When setting to disabled, then the mouse copy/paste function will be disabled.

Attached is the Windows binary, along with all required DLLs, zipped:
You do not have the required permissions to view the files attached to this post.
Last edited by Wengier on 2014-10-25 @ 20:45, edited 2 times in total.
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby Wengier » 2014-10-25 @ 20:19

And the source diff for the mouse copy/paste feature alone (note that it now contains a curses.h header file for PDCurses, in order to be 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 emendelson » 2014-10-25 @ 20:38

Hello Wengier,

Thank you for all your work on this excellent patch. One question:

Could you make the Paste function mappable to a keystroke, so that we could use the mapper (or patch the source code) so that (for example) Ctrl-Alt-V would paste to the cursor location, without using the mouse?

I tried to do that with your source code, but I don't know enough to make it work.

Thank you again for this!
emendelson
Oldbie
 
Posts: 700
Joined: 2010-2-14 @ 02:00

Re: Mouse copy/paste support

Postby Wengier » 2014-10-25 @ 21:06

emendelson wrote:Hello Wengier,

Thank you for all your work on this excellent patch. One question:

Could you make the Paste function mappable to a keystroke, so that we could use the mapper (or patch the source code) so that (for example) Ctrl-Alt-V would paste to the cursor location, without using the mouse?

I tried to do that with your source code, but I don't know enough to make it work.

Thank you again for this!


How about making a function key shortcut say e.g. ALT-F? for this feature, similar to CTRL-F9 which will close DOSBox and CTRL-F10 which will capture/release the mouse?
Wengier
Member
 
Posts: 110
Joined: 2014-9-03 @ 19:56

Re: Mouse copy/paste support

Postby emendelson » 2014-10-25 @ 21:28

An F-key assignment would be ideal. In an older project (based on someone else's code which is very hard to maintain and not nearly as good as yours), I use Ctrl-Alt-F4, but anything would be good, as long as it can be changed in the mapper or source code.

Thank you again!
emendelson
Oldbie
 
Posts: 700
Joined: 2010-2-14 @ 02:00

Re: Mouse copy/paste support

Postby truth_deleted » 2014-10-25 @ 21:46

The pdcurses based clipboard function works great. It's a brilliant solution to cross-platform clipboard access!

This addition may allow your patch to detect a "pdcurses installation" and link with the pdcurses library (requires an edit to config.h for VS users or "configure --enable-clipboard" in the case of automake users):
Code: Select all
diff -rupN dosbox-SVN//configure.ac dosbox-CLIP//configure.ac
--- dosbox-SVN//configure.ac   2014-02-10 21:48:18 -0500
+++ dosbox-CLIP//configure.ac   2014-10-25 17:11:07 -0400
@@ -219,6 +219,21 @@ AC_ARG_ENABLE(debug,AC_HELP_STRING([--en
    fi
 ],)
 
+AH_TEMPLATE(C_CLIPBOARD,[Define to 1 to enable CLIPBOARD, requires libpdcurses])
+AC_ARG_ENABLE(clipboard,AC_HELP_STRING([--enable-clipboard],[Enable clipboard mode]),[
+   AC_CHECK_HEADER(curses.h,have_curses_h=yes,)
+   AC_CHECK_LIB(pdcurses, initscr, have_pdcurses_lib=yes, , )
+
+   if test x$enable_clipboard = xno; then
+     AC_MSG_RESULT([Clipboard not enabled])
+   elif test x$have_pdcurses_lib = xyes -a x$have_curses_h = xyes ; then
+     LIBS="$LIBS -lpdcurses"
+     AC_DEFINE(C_CLIPBOARD,1)
+   else
+     AC_MSG_ERROR([Can't find pdcurses, which is required for clipboard mode])
+   fi
+],)
+
truth_deleted
 

Re: Mouse copy/paste support

Postby Wengier » 2014-10-25 @ 22:09

emendelson wrote:An F-key assignment would be ideal. In an older project (based on someone else's code which is very hard to maintain and not nearly as good as yours), I use Ctrl-Alt-F4, but anything would be good, as long as it can be changed in the mapper or source code.

Thank you again!


OK, so here you go (it will use Alt-F10 as the assignment for the paste function). I have attached the Windows binary (along with all required DLLs, zipped) and the updated patch for the copy/paste feature.
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 emendelson » 2014-10-25 @ 22:19

Terrific, Wengier! Thank you again!

If you would be willing to post all the changed (and new) files, that would be very, very helpful, but I know we keep asking you for things... Thank you!
emendelson
Oldbie
 
Posts: 700
Joined: 2010-2-14 @ 02:00

Re: Mouse copy/paste support

Postby Wengier » 2014-10-25 @ 22:54

emendelson wrote:Terrific, Wengier! Thank you again!

If you would be willing to post all the changed (and new) files, that would be very, very helpful, but I know we keep asking you for things... Thank you!


No problem. I have attached the zip containing all source files that have been changed (plus the new curses.h) in the latest build from the latest DOSBox SVN version (r3871). For the mouse copy/paste feature alone however, only changes in sdlmain.cpp, mouse.cpp and mouse.h (and the addition of curses.h) are required.
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

PreviousNext

Return to DOSBox Patches

Who is online

Users browsing this forum: Google [Bot] and 1 guest