drag-drop

command
v0.1.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Native drag and drop

Run go run ./examples/drag-drop, or package it with go run ./cmd/golet build examples/drag-drop.

Drag notes between the two windows. Both allow copy and move; the source removes its note only after a successful move. Drag a note to a text editor to receive its plain text, a URL to a browser, and the sample file to Finder, Explorer, or a Linux file manager. Sample files always copy. Drop files, selected text, URLs, or notes from a second instance back into either window. Escape cancels; the status and log show completion.

The note has plain text and a lazy JSON representation. The JSON is decoded explicitly by the receiver. Drag(note) also makes its Go value available to typed destinations in the same process; this example uses serialized destinations so it works across application instances too.

Documentation

Overview

Drag-drop exchanges notes, text, URLs and files between two native UI windows and other applications. Hold Option (macOS) or Ctrl (elsewhere) to request a copy; Cmd (macOS) or Shift (elsewhere) requests a move.

go run ./examples/drag-drop

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL