-
Notifications
You must be signed in to change notification settings - Fork 542
Open
Description
The scripting API provides a copySelection(...) function, which is presented as 3 different functions in the documentation, all specified as follows (except for variation in synopsis):
Equivalent to the
copyfunction with the same arguments, but for Linux mouse selection.Throws:
Error() – Thrown if selection fails to be set.
This is unclear, mostly because:
- Most variants accept a single argument.
- It is not really specific to Linux (BSD seems to be somewhat supported).
- It is not specific to mouses.
The following clarifies:
diff --git a/docs/scripting-api.rst b/docs/scripting-api.rst
--- docs/scripting-api.rst
+++ docs/scripting-api.rst
@@ -295,9 +295,9 @@
:rtype: bool
.. js:function:: copy(text)
- Sets clipboard plain text.
+ Sets the system clipboard to the specified string (of plain text).
Same as ``copy(mimeText, text)``.
:throws Error: Thrown if clipboard fails to be set.
@@ -362,24 +362,27 @@
popup('Copied Text', text)
.. js:function:: copySelection(text)
- Equivalent to the ``copy`` function with the same arguments, but for `Linux
- mouse selection`_.
+ On X11, equivalent to the ``copy`` function with the same argument, but modifying the ``PRIMARY`` selection atom rather than ``CLIPBOARD`` (see `Linux
+ mouse selection`_).
+ On other platforms, has no effect (no-op).
:throws Error: Thrown if selection fails to be set.
.. js:function:: /*data*/ copySelection(mimeType, data, [mimeType, data]...)
- Equivalent to the ``copy`` function with the same arguments, but for `Linux
- mouse selection`_.
+ On X11, equivalent to the ``copy`` function with the same arguments, but modifying the ``PRIMARY`` selection atom rather than ``CLIPBOARD`` (see `Linux
+ mouse selection`_).
+ On other platforms, has no effect (no-op).
:throws Error: Thrown if selection fails to be set.
.. js:function:: /*item*/ copySelection(Item)
- Equivalent to the ``copy`` function with the same arguments, but for `Linux
- mouse selection`_.
+ On X11, equivalent to the ``copy`` function with the same argument, but modifying the ``PRIMARY`` selection atom rather than ``CLIPBOARD`` (see `Linux
+ mouse selection`_).
+ On other platforms, has no effect (no-op).
:throws Error: Thrown if selection fails to be set.
.. js:function:: paste()
License
This report (including all messages and attachments I add to it) is offered under the terms of CC0 1.0.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels