Sha256: bc9035215795f4b3088e0cb0f92b449d54599026aa548662cc69eba6e6070b96
Contents?: true
Size: 604 Bytes
Versions: 9
Compression:
Stored size: 604 Bytes
Contents
# frozen_string_literal: true module Clipboard # Basic java clipboard access (jruby). No fun to use on X. module Java extend self FLAVOR = ::Java::JavaAwtDatatransfer::DataFlavor.stringFlavor def copy(text) selection_string = ::Java::JavaAwtDatatransfer::StringSelection.new text ::Java::JavaAwt::Toolkit.default_toolkit.system_clipboard.set_contents selection_string, nil paste end def paste(_ = nil) ::Java::JavaAwt::Toolkit.default_toolkit.system_clipboard.get_data(FLAVOR) rescue '' end def clear copy '' end end end
Version data entries
9 entries across 9 versions & 1 rubygems