A (nearly---the ICCCM specifies some modes which I've never seen in the
wild and so I haven't implemented) complete demonstration of how to use the X11 clipboard
and drag and drop systems.
The paste
program can ask for any kind of data from any
clipboard and will output the data on the standard output. The XDnD
(drag and drop) protocol exchanges data using the clipboard mechanism
and the paste
program includes the XDnD logic required to
perform an XDnD transaction.
selection
places an image in to any clipboard. Applications
wishing to paste can paste it as an image or as the URL of the image. This
program also includes XDnD logic, and can drop types on to a target.
Both programs can make use of either clipboard (in fact any clipboard for copy/paste operations). The only missing feature is the ability to handle very large selections, i.e. ones which are too large to fit in to a single property. Both programs print out all the salient data transmitted and received with respect to selections. It is quite interesting to see how different programs operate, and how they don't obey the ICCCM.
Both programs are written in C++ (mostly for convenience of C++ strings, and file handling and a few containers). All the X11 interaction code is in plain C, so it should be understandable to anyone without C++ experience.
Extensive documentation about the workings is included in
paste.cc
.
Download: x_clipboard-1.1.tar.gz
Browse: x_clipboard-1.1
Changelog: ChangeLog
selection
can not drop things on Konqueror.
scribe < letters > new_letters
The list of strokes is read from the standard input. These are written one per line, with the keysym name first and the stroke next. The stroke is written in libstroke format. New strokes are written to the standard output. If a stroke is unrecognised, then the window will flash. At this point, if you type a key in the window, then it will assosciate that key with the stroke.
Type "f" in the window to select which window keystrokes will be sent to.
Press "Escape" to exit cleanly and save the all strokes including any new ones.
Libstroke is required for this! The library seems to be stalled at 0.5.1, and not updated since 2001. But don't be fooled: this is because it works and is essentially finished.
It comes with a file called "letters" containing strokes for my handwriting.
Updated March 28th 2013, 11:39