Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Copy to clipboard, no paste #934

Open
5 of 16 tasks
jahagirdar opened this issue Jan 8, 2024 · 15 comments
Open
5 of 16 tasks

Feature: Copy to clipboard, no paste #934

jahagirdar opened this issue Jan 8, 2024 · 15 comments

Comments

@jahagirdar
Copy link

AutoKey is a Xorg application and will not function in a Wayland session. Do you use Xorg (X11) or Wayland?

Xorg

Has this issue already been reported?

  • I have searched through the existing issues.

Is this a question rather than an issue?

  • This is not a question.

What type of issue is this?

Enhancement

Choose one or more terms that describe this issue:

  • autokey triggers
  • autokey-gtk
  • autokey-qt
  • beta
  • bug
  • critical
  • development
  • documentation
  • enhancement
  • installation/configuration
  • phrase expansion
  • scripting
  • technical debt
  • user interface

Other terms that describe this issue if not provided above:

No response

Which Linux distribution did you use?

Distributor ID: Linuxmint
Description: Linux Mint 21.2
Release: 21.2
Codename: victoria

Which AutoKey GUI did you use?

GTK

Which AutoKey version did you use?

0.95.10

How did you install AutoKey?

apt

Can you briefly describe the issue?

Different applications have different paste mechanism, This makes reuse of phrase across applications difficult.
e.g. most applications accept Ctrl+V but Terminal requires Ctrl + Shift + V
Currently we have a Paste option which forces us to select one of the available method.
Adding a copy to clipboard only method which copies the phrase to clipboard for 10 sec will allow the user to use an application specific paste method.

Can the issue be reproduced?

Always

What are the steps to reproduce the issue?

Create a phrase,
set paste option to Ctrl V,
Try pasting in Gnome Terminal

What should have happened?

Phrase should be pasted

What actually happened?

Phrase is not pasted

Do you have screenshots?

No

Can you provide the output of the AutoKey command?

No response

Anything else?

No response

@josephj11
Copy link
Contributor

Welcome to the AutoKey community, @jahagirdar !

While this could be added, IMO, it would probably be better (and it is already possible) to handle this as a script rather than as a phrase.

The script could copy the desired text to the clipboard and then retrieve the active window class and/or title. It would then determine the appropriate way to paste for that application.

The window class is usually indicative of what the underlying application is.

The only fine point would be to take into account that all our clipboard API calls are asynchronous which is a fancy way of saying that you have to add a small delay in your script after every clipboard API call to give it time to complete before trying to use the results of that action.

This can be implemented by a very short script. It also makes it so the user doesn't have to respond quickly with the correct manual action after pressing the hotkey or typing the trigger abbreviation.

If you would like assistance in writing such a script or want to discuss anything else related to AutoKey, join us over in our forum or on Gitter.


I notice that you are not running 0.96.0, our current release. This release contains a lot of bug fixes and a few new features. We highly encourage users to upgrade as soon as possible. You can find it here and instructions are here.

The installation is pretty easy to do and we also provide .deb packages for users of Debian and Debian-derived distributions (Ubuntu, Mint, ...).

@lebergerdesphotons
Copy link

been trying to understand your documentation for a while. Getting nowhere. I assigned a key combination to "my first phrase". I can't make that key combination paste that phrase anywhere. I guess I've completely misunderstood what you mean by everything you've written. just to get control and a character to show up as the trigger which still doesn't work was completely unintuitive.

@lebergerdesphotons
Copy link

why is it that people who write applications for windows arrive with a product which anybody can use instantly and people who write linux applications constantly have exceptions and excuses for why it doesn't work out of the box? I've read recently that there is a whole crop of doofuses who will chime in here (unless you've banished them somehow) and tell me that I'm a doofus. I don't know whether that will happen and I don't care, we all need to not care about what people we don't know say to us. That after 44 years of using operating systems that nobody has made an intuitive app to have a hotkey paste a phrase in linux says a lot. I have a theory that Microsoft is the most prolific financial supporter of linux developers. It makes sense, like that they can profit from this resource without anybody else getting any use out of it. I first noticed this when I saw that google earth is terrible on linux and excellent on windows. The things which make it terrible on linux are configurable on windows and hidden from view on linux.

@josephj11
Copy link
Contributor

@lebergerdesphotons Welcome to the AutoKey community!

Please give us a chance to assist you before you get mad at us!

First, a few generic responses:

We prefer to handle support on our Google Groups forum or on Gitter, as noted in my reply to the OP. But, as long as you are already here...

Many Linux applications assume you know a lot about how things work in Linux before you use them. AutoKey has a lot of users who just use phrases and we try to reduce such prerequisite knowledge as much as possible. We have all been frustrated by man pages, etc. that assume you know a great deal and just need to remember what some arcane option does. We try not to be that way.

I'm not sure what "documentation" you are referring to. We have put many hours of work into our wiki which contains a number of articles on how AutoKey works and how to address specific situations along with many example scripts. The goal is to be as accessible as possible to both beginners and advanced users.

I am sure that the wiki can always be improved, but we need specific feedback to know what is unclear or that you are misinterpreting for some reason.

If you're not already using our current release of AutoKey, 0.96.0, be sure to upgrade first. See my response to the OP above for how to do that. It will probably make a big difference to you sooner or later.

More specifically:

The following looks long and involved, but is really just a few mouse clicks and keypresses once you're familiar with how it works.

To assign a hotkey to an existing phrase

  • Open the phrase from the navigation panel on the left of the AutoKey main window
  • The panels on the right will display information about the phrase and its settings
  • Toward the lower right, you will find a line that starts with Hotkey:
  • On that line, click on the Set button. This will open the Set Hotkey dialog
  • In the Set Hotkey dialog, click on Record a key combination
  • Press and hold any desired modifier key(s) such as Super (the "Windows" key on most keyboards) or Ctrl
  • Press a normal key such as g and then release all pressed keys
    Your desktop environment and application window(s) already have a number of hotkeys assigned to various functions. Be sure not to accidentally choose one that is already assigned to something, (No, AFAIK, there is no generic way to know what hotkeys are already assigned to something. You just have to be careful and figure it out empirically.)
  • Click on OK
  • The dialog will close and you should see the assigned hotkey combination next to the Hotkey: label
  • Unless you have a specific requirement, you should make sure that Clipboard (Ctrl+V) is selected as the Paste using method in the associated drop down list
  • Click on Save on the Main menu bar near the top left of the main window to save your changes
    You can set AutoKey to automatically save such changes when the Main window is closed, but while it is still open, the changes will not go into effect until you click the Save button
  • Select or open a window where you will test your phrase
    It is usually best to use an application which is as simple as possible for your first test.
    A text editor such as kate or gedit is a good choice because such applications have less hotkeys and other special actions already defined that might conflict with your new hotkey
  • Once you see that the hotkey works, you can try it in the application window(s) it is designed to be used with
  • Once that works, you can add special features to your phrase like the Phrase settings and Window filters

Some variations to the above sequence are possible, but they should be avoided until you are comfortable using AutoKey's basic functionality and have a basic understanding of how to figure out what's wrong if something doesn't work as expected.

@lebergerdesphotons
Copy link

lebergerdesphotons commented Mar 18, 2024 via email

@josephj11
Copy link
Contributor

josephj11 commented Mar 18, 2024

@lebergerdesphotons Just reread your second post. "We're All Bozo's On This Bus" - to really date myself ;).

The rest of these comments are in no particular order.

Clicking on the modifier keys before clicking on Record does not work and is a forever bug.

So far, we haven't banished anyone in all these years and have only had one troll who temped us.

I have no idea what distro Virginia and Vanessa refer to, but I'm glad one of them works for you.

Long ago and far away, MS invested in Apple just so Apple wouldn't die and leave them without competition that they could complain about to anyone filing antitrust actions against them. We see how that turned out!

Microsoft was eventually forced to acknowledge, however grudgingly, that Linux is a much more powerful environment for developers (and for the most part, for servers), so they adopted some of it (WSL...) to keep them happy. Linux was and still is one size for each person, which is way beyond the normal user's capabilities to understand and maintain, so Windows with all its drawbacks remains the OS of choice for most users.

However, if you haven't gotten snarled up with that demonic invention called the Registry, you haven't done much in Windows. And what you get is mostly what you're stuck with whether you like it or not whereas my Linux DTE (using KDE) isn't like anyone else's and, for the most part, eats out of my hand.

Linux users for the most part expect everything to be FOSS and free, Traditional corporations have a very hard time learning how to make money in that environment and don't want to give up the control that closed environments give them.

IMO, AutoKey is the most powerful desktop Automation tool for Linux (and will continue to be for the foreseeable future if we can get some new developers and get most or all of it ported to work on Wayland). Unfortunately, that's a big
'if" ATM. However, we have a number of partial competitors. See #775 .

As Far as no one getting any use out of Linux, that blasphemy tells me you are not a fluent CLI (command line interface) user. There is nothing anywhere that even comes close to what you can do with a bit of bash or other shells. If you don't learn the basics of that, you are missing the true glory and wonder of Linux.

If you want a new feature of any sort, feel free to open a feature request issue. (And then help us recruit some developers to implement it.)

Windows and Android (and probably iOS) have a lot of data harvesting built in. I'm somewhere between a Liberal and a Libertarian (not a very comfortable combination) and into cryptocurrencies, so don't get me started on that unless you want to take the discussion somewhere else that won't bore or upset everyone else here. :)

@lebergerdesphotons
Copy link

lebergerdesphotons commented Mar 18, 2024 via email

@josephj11
Copy link
Contributor

josephj11 commented Mar 18, 2024

I am currently stuck using a very old flea watt notebook that crashes a lot, so I'm forced to update comments before I'm done so I don't lose them. You replied while I was still editing the last one.

Very long ago and far away, I got a job at a bank developing standalone teller terminal software on a UNIX System III development system. I already knew a little C and assembly language, so I got the job and learned UNIX. Since I left there, I switched over to Linux as soon as I discovered it (RedHat 7.2 then Mandrake 9.1) and have been using it ever since at home. I haven't made any money from it though. I haven't booted into Windows for quite a few years and am quite pleased about that. When I last used it, I would boot into it infrequently and spend almost the entire time running many hours of Windows updates. I really don't miss that!

If you want a good password on Linux, I don't know how to do it, but I'm sure there is a way to set it up with 2FA using a Yubikey or similar. I always wanted one of those and may eventually get one to use with a crypto hardware wallet.

BTW. GitHub supports markdown, so you can make quoted text look like quotes... to make it easier to read.

Yep. YubiKey.

@josephj11
Copy link
Contributor

Oh. Just for sanity, in AutoKey, the Python scripts you write to do things that phrases normally can't do are called "scripts".

The term "macros" is reserved for active things you can embed in phrases that are of the form <keyword...> such as <code...>, <cursor>, <left>, ...

@lebergerdesphotons
Copy link

lebergerdesphotons commented Mar 18, 2024 via email

@lebergerdesphotons
Copy link

lebergerdesphotons commented Mar 18, 2024 via email

@josephj11
Copy link
Contributor

If you were into Dilbert, I think of myself as the Pointy Haired Boss of AutoKey. I do management and support. Other than writing some scripts and merging the occasional PR from someone else, I don't do any coding on AutoKey. I only know a little Python.

The Ubiquiti thing sounds great. That and mesh networks are the future, but not as a business for me.

Markdown. There's also a link right below this entry panel when it's open for editing. Markdown is useful to know because a lot of sites use it. The basics are very simple and we have some example scripts in the wiki that wrap text in tokens that could be adapted for use with markdown.

I'm enjoying this discussion, but we really need to get it off of GitHub. We don't want to fill things up with OT content. We could continue on Gitter either in a public or private room, use email, chat, or even keet.

@lebergerdesphotons
Copy link

lebergerdesphotons commented Mar 19, 2024 via email

@josephj11
Copy link
Contributor

Googleearth: I have never played with it. But, if you can do what you want manually with an algorithm of keyboard and mouse actions, you can probably code that into an AutoKey Python script.

The generic problem is that virtually no sites are designed to be automated, so figuring out the exact sequence needed can be tricky - especially making sure your cursor is in the right place to start with.

I have had some epic fails when I have run multi-step scripts from the wrong starting point by accident. Once a script starts, you just sit there watching it do ridiculous things and there's usually nothing you can do about it until it stops itself.

Also, the designers change their website and application layouts whenever they feel like it and that generally wrecks most automation scripts.

@josephj11
Copy link
Contributor

The Gitter link above will take you straight to our Gitter page. You have to make a free account to use it. Once there, you can post in the AutoKey room and I can either reply in thread to start a thread that no one else will see unless they explicitly click on it. I can also see your Gitter handle and use it to invite you to a private room I have there.

I'm not a chat person, so that would be up to you.

For email, we'd have to exchange addresses. We could do that in a Gitter private room.

I'm new to keet, but it looks really slick. I think I would have to send an invite from it to your email (and you would have to have it installed on your system). Then, we have encrypted text, voice, and video if we want it along with the ability to invite others to join as appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants