VOGONS

Common searches


Mouse copy/paste support

Topic actions

Reply 20 of 151, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author
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.

Reply 22 of 151, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Does it work?

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 23 of 151, by truth_deleted

User metadata

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.

Reply 24 of 151, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Great!

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 25 of 151, by Wengier

User metadata
Rank Member
Rank
Member
truth5678 wrote:
Great! For the linux diff tool, please try this: diff -rupN dosbox-ORIG/ dosbox-CHANGED/ > patch.diff. This will enforce the p […]
Show full quote

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

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.

Reply 26 of 151, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

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.

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 27 of 151, by Wengier

User metadata
Rank Member
Rank
Member
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)?

Reply 28 of 151, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

That conf setting could work, though the dosbox devs are always very hesistant about config settings.

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 30 of 151, by Wengier

User metadata
Rank Member
Rank
Member
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).

Reply 31 of 151, by Wengier

User metadata
Rank Member
Rank
Member

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:

Attachments

  • Filename
    dosbox.zip
    File size
    1.76 MiB
    Downloads
    103 downloads
    File license
    Fair use/fair dealing exception
Last edited by Wengier on 2014-10-25, 20:45. Edited 2 times in total.

Reply 32 of 151, by Wengier

User metadata
Rank Member
Rank
Member

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

Attachments

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

Reply 33 of 151, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

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!

Reply 34 of 151, by Wengier

User metadata
Rank Member
Rank
Member
emendelson wrote:
Hello Wengier, […]
Show full quote

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?

Reply 35 of 151, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

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!

Reply 36 of 151, by truth_deleted

User metadata

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):

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
+],)
+

Reply 37 of 151, by Wengier

User metadata
Rank Member
Rank
Member
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.

Attachments

  • Filename
    patch.diff
    File size
    58.49 KiB
    Downloads
    83 downloads
    File license
    Fair use/fair dealing exception
  • Filename
    dosbox.zip
    File size
    1.76 MiB
    Downloads
    80 downloads
    File license
    Fair use/fair dealing exception

Reply 38 of 151, by emendelson

User metadata
Rank Oldbie
Rank
Oldbie

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!

Reply 39 of 151, by Wengier

User metadata
Rank Member
Rank
Member
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.

Attachments

  • Filename
    srcchanges.zip
    File size
    214.21 KiB
    Downloads
    81 downloads
    File license
    Fair use/fair dealing exception