Coder Social home page Coder Social logo

System clipboard integration about turbo HOT 2 CLOSED

magiblot avatar magiblot commented on July 17, 2024
System clipboard integration

from turbo.

Comments (2)

magiblot avatar magiblot commented on July 17, 2024

Hi Brian, I saw your build broke, but I had this error when trying to build tmbasic, so I couldn't create a patch for you:

ERROR: failed to solve: executor failed running [/bin/sh -c mkdir -p /tmp/downloads &&     tar xf /tmp/deps.tar -C /tmp/downloads &&     mkdir -p /usr/local/$(uname -m)-linux-gnu/include &&     mkdir -p /tmp/deps &&     cd /tmp/deps &&     export NATIVE_PREFIX=/usr &&     export TARGET_PREFIX=/usr/local/$(uname -m)-linux-gnu     export ARCH=x86_64     export LINUX_DISTRO=ubuntu     export LINUX_TRIPLE=$(uname -m)-linux-gnu     export TARGET_OS=linux     export DOWNLOAD_DIR=/tmp/downloads &&     make -j$(nproc) -f /tmp/deps.mk &&     rm -rf /tmp/deps /tmp/deps.mk]: exit code: 2

Clipboard integration is explained here.

In short, you will now receive paste events as regular text events. This way, you process pasting from the system clipboard in the same way as pasting through the terminal.

Therefore, the equivalent of storing the clipboard contents in a string is now:

void MyView::handleEvent(TEvent &ev)
{
    if (ev.what == evKeyDown)
    {
        if (ev.keyDown.controlKeyState & kbPaste)
        {
            std::string s;
            char buf[512];
            size_t length;
            while (textEvent(ev, buf, length))
                s.append(buf, length);
            // 's' now contains the clipboard contents
        }
    }
}

Also, the dependencies for clipboard support have changed. libclipboard is no longer required, but the guest system requires having the xclip, xsel (X11) or wl-clipboard (Wayland) applications installed. On macOS and Windows, it works out-of-the-box.

from turbo.

electroly avatar electroly commented on July 17, 2024

Thanks so much! I was able to fix my bit rot and implement the clipboard changes. Dropping libclipboard allowed me to drop several unpleasant X11 deps that I was building from source. Looks great!

from turbo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.