Replies: 23 comments 74 replies
-
I have no idea about anything going on at that low level interface. Maybe there's something in a package like tkinter that addresses it. There's likely something in Python somewhere that deals with it. Here's something a quick search revealed. Depending on what happens with AutoKey and Wayland, it may become a dead issue at some point. |
Beta Was this translation helpful? Give feedback.
-
Each of our front ends use different modules to get the job done. The clipboard_gtk.py file imports code from the Gtk, Gdk, and Path modules. The clipboard_qt.py file imports code from the QClipboard, QImage, QApplication, and Path modules. I also did a That's about the extent of what I've got that would be of any possible use, and the kinds of changes that would have to be made to incorporate and/or take control of clipboard ownership are beyond my abilities. What @josephj11 meant by the last statement is that if Wayland continues to take over (and it looks like it will), then X will soon be a thing of the past, in which case all of this X-clipboard code will no longer be used. |
Beta Was this translation helpful? Give feedback.
-
@ineuw I'm saying that any application code that interfaces directly with the clipboard is low level code and is undoubted handled by either base Python or the modules we import. So, our current code is just using whatever is provided at a lower level as @Elliria mentioned. As for X11 going away, there are so many things that rely on it that it may be quite some time before that happens. As for the other modules I mentioned, that's for reference if someone is creating new code outside of AutoKey or just wants to see how they deal with the clipboard. I'm not suggesting we build any of that into AutoKey itself. If one or more of those does anything AutoKey doesn't currently support, individual users can use them in their own scripts to the extent that they don't conflict with what AutoKey is already doing, |
Beta Was this translation helpful? Give feedback.
-
Another module that may be worth exploring for use in scripts is pyperclip. |
Beta Was this translation helpful? Give feedback.
-
It will be interesting to see how your pyperclip journey goes. I also see a lot of links to it, but haven't tried it yet. And do let us know if there's anything we can do with the other small AutoKey issues, @ineuw. |
Beta Was this translation helpful? Give feedback.
-
@ineuw When you do experiment with pyperclip..., we need to know what, if anything, it does differently or better than AutoKey does now. |
Beta Was this translation helpful? Give feedback.
-
While silent, I haven't been idle and came to realization that I can only contribute on the Gnome / GTK / Cinnamon platform, because this is what I understand best. I have Kubuntu as well but use it only as a reference. In essence, not all of the AK-Qt Preferences work in this environment, and I ran out of time to devote to it. Would it be possible to tag each comment (like this one) to categorize in more detail? Our conversations are important, but it's the only solution I can think of that would tie the same subjects together regardless which group it was posted in. |
Beta Was this translation helpful? Give feedback.
-
We will never copy and paste with 100% certainty until Autokey has full control of the clipboard, and be able override hotkeys from other apps. In my environment, the mouse's 1st role is to focus by clicking. The 2nd is to scroll the page. Copy and paste with the mouse is disabled. After re-reading the ICCM document, there is nothing to prevent apps to alter the original intent because developers can access and do whatever they want to suit their needs. This includes taking ownership of any or all of the clipboard's memory areas, even if they don't need them. (Which what we need to do). A script that outputs the contents of each clipboard memory area, would be a welcome tool. My Windows clipboard experience was it was always one copy and one paste and this would be nice to have in Linux. |
Beta Was this translation helpful? Give feedback.
-
@ineuw Our API knows about the PRIMARY selection and the clipboard, so those are probably easy to do in a script. Some other tool would be needed to get the SECONDARY selection - if you really want to bother with it at all. The only tricky part would be saving and restoring the current clipboard contents if you need to pass the PRIMARY selection through the clipboard to print it, etc. |
Beta Was this translation helpful? Give feedback.
-
@ineuw I must be missing something: Here is a very simplistic script that seems to work fine for me in autokey-qt.
Notes:
Also, if you don't like how the clipboards work, just write your own in AutoKey. I recently showed you the scripts I wrote to do that for me. They are very short and simple. I have a fancier version in mind that imlements a clipboard as a LIFO stack, but haven't gotten around to writing it. I want to use it so I can copy several fields from one window and then paste them in reverse sequence in another window without having to go back and forth between the windows several times. I mention this because it illustrates that you can make your own "clipboard" work any way you are creative and skilled enough to implement. |
Beta Was this translation helpful? Give feedback.
-
I figured it must be something else. Does this happen when you do it manually? I assume it does. If so, the problem is clearly outside of AutoKey's control and may be a bug in Linux somewhere that needs to be addressed. Given that clipboards are very widely used, you can't be the only person affected by this and it should be documented somewhere. Finding it is another issue. A 10 second window is forever in computer time, so it's clearly not a simple race condition. I would start by searching and posting on stackoverflow. That's where the uber geeks hang out. If you run into it enough for it to be a problem, then make your own clipboard in AutoKey and see if you can get that to work as desired. Glad to help if there's anything you need. |
Beta Was this translation helpful? Give feedback.
-
Yes. The clipboard has to be the first step, so it's still problematic, but if you abandon a paste, you can clear your clipboard, etc. You may not have ultimate control, but you should have more. You can know if a second copy has occurred without an intervening paste. I don't know how it would work, but if you know the clipboard contents should have changed, but didn't you can do something about that. Also, if you know that after some time, the problem goes away, then your script can know if that time has elapsed. IDK if any of this will make anything better, but something should help. |
Beta Was this translation helpful? Give feedback.
-
Another important point to be added to bug report questionnaire is the working environment. Offline apps or online and in which browser. Autokey behaves differently in various browsers, or not at all, under certain conditions. My worst online experience is composing in gMail in Firefox, in Linux Mint Cinnamon. I got so fed up that I switched and manage gMail from Thunderbird. Consider a browser (Firefox) which opens in an X-Window based technology, and manipulated by the distro. Then add to it the gMail main window in a browser tab, and open another window in which you compose the email. Just watch the mouse going exhibiting tremor and the non-responsive keyboard. The number of windows within windows? Who is the boss? I posted this issue on Mozillazine years ago, and their response was, "don't use gMail in Firefox", it's a Google product. |
Beta Was this translation helpful? Give feedback.
-
On rereading this thread, I realize that my tone may have upset you, which is understandable. It was only an overenthusiastic suggestion. All I can do is add to your data as a wayward user, nothing else. I feel a great debt to both of you @Elliria & @josephj11, and thanks for the time spent commenting and testing, which revealed the problem. It's my terrible (and quirky way) of working with either the mouse or the keyboard, partly from habits acquired from very long ago, which complicates everything. This led me to this LAST idea for people who may work in crazy ways like me, . . . . . Can the two copy and paste options be merged into Ctrl-c and Ctrl-v? Or negate Ctrl-Ins and Shift-Ins (known from Windows days) Only if this change has that will not interfere with the mouse? I am hoping that it eliminates my copy and paste issues universally. I haven't had the chance, to use the code, but much much thanks. The changes are clear. |
Beta Was this translation helpful? Give feedback.
-
Consider this no priority question and not Autokey's domain. Some users of the community center where I volunteer, including myself, purchased from Staples a 105 key QWERTY Canada International French keyboard oddity. The keyboard assignments made it useless, but the kybd fascinated me after using it. A $14 wired keyboard has chicklet keys motion that are a pleasure to type with, as long as one doesn't need the Function keys. The manufacturer defaulted the 12 keys to be Multimedia and Display controls, and assigned the normal function keys to be used with the addition of a [Fn] key (key 125). I used the trace to see what happens and the output is the 3rd and 4th lines below. When tapping the [Fn] key, it generates Key Alt.pressed twice. and I think it's followed by a bug?
Can the keys be overridden or blocked and the Function key keycodes re-assigned by Autokey? I ask this because of my prior experience with AutoHotkey in Windows where keycodes could be re-assigned? |
Beta Was this translation helpful? Give feedback.
-
Sincere apologies, this was one of my silliest post in Autokey. "Silliest" because the kids forbid me to say stupidest. Thanks for reminding me about the x utilities. I know that laptops can select the layout in the BIOS. |
Beta Was this translation helpful? Give feedback.
-
The most difficult place to find anything is usually right in front of you! Had it happen many times. My thinking gets locked on a particular path as the only way. When I sleep on it, sometimes I see an alternative that was right there, but I couldn't see it because it didn't match my expectations. Believing is seeing, not usually the other way round. I probably shouldn't stray into politics, but ... PC (politiclally correct) terminology is really a way of supressing innovation and thought. Instead of fostering inclusivity it really reinforces conformity. I'm all for personal freedom and people doing almost anything that doesn't hurt other people, but communication is hard enough without having to worry if you'll offend someone by using the wrong adjective or pronoun. Intent is what really matters. |
Beta Was this translation helpful? Give feedback.
-
This is a new twist on the ongoing story. The attached screenshot displays an anomaly. "{{fs85/s}}" is a simple one line script activated by a single key [F4]. There is no clipboard involved. "{{fs90|}}" is activated by a script wrapping a selected text. If it's empty, then the result should be the empty template. I placed "{{fs85/s}}" in the page header using [F6]. Then, with a single keyboard tap on the key, it placed the cursor at the top left corner of the page known as the 'textarea' where I tapped [win+9] without text selection. "{{fs85/s}}" appeared as the selected text. There was no selection used with either template. This reinforces my bafflement at the unknowns lurking in Linux showing up occasionally when one strays away from a packaged distro. Also my belief based on occasional observation, that the Then, perhaps the browser itself contributed? Since I use Autokey 99.9% in Firefox, I will check on what changed or added to its default behavior, etc. More about browsers' behavior when using the mouse in another post later.
|
Beta Was this translation helpful? Give feedback.
-
I found the origin of clipboards, of all places, in the middle ages. |
Beta Was this translation helpful? Give feedback.
-
Bingo. Based on exaggerated trauma of my past failures, I am making a very cautious announcement that the problem seems to be solved causing me additional lack of sleep. :-)
|
Beta Was this translation helpful? Give feedback.
-
Great! After you're sure this is stable across applications, add it to our wiki with any notes about why it has to be done this way. Your second delay is either unneccessary or can be combined with the first one because nothing interesting happens between them. |
Beta Was this translation helpful? Give feedback.
-
I added another script last week, but I can't find it. Was it rejected? It's about extracting the left, mid, or right of strings by length. |
Beta Was this translation helpful? Give feedback.
-
This script includes the changes I mentioned above.
|
Beta Was this translation helpful? Give feedback.
-
This is a focused conversation on the clipboard only. Consider it a continuation of this discussion and it applies to X-Windows clipboard regardless of the environment.
I've been looking through my contributions these past days, and in the above discussion, my eyes caught @Elliria's comment . . . .
. . . And my reply is that you figured right!
I've been very closely monitoring the failure of my scripts, and gradually, I managed to reduce the failures generated by my lack of Python coding experience.
Issues still exist occasionally, and I am determined to find leads, (if not the solution) why these occur and think I found an important clue to some of the clipboard related issues which wexed everyone one time or another.
The info is in a link in the Wayback article document.
Find the section on XGetSelectionOwner and XSetSelectionOwner
We could use a simple function that outputs the information of these objects, preferably at various stages of a running script. This will eliminate our assumptions.
Then, if we can control these from within Autokey, it will resolve the control of the clipboard storage — but only the storage.
Clarification of the hierarchy of keyboard and mouse interactions with the clipboard are important for us to understand so that we can find and resolve issues quickly.
This would complete our understanding of the triangle of this relationship.
P.S: Control of the "PRIMARY" is also mentioned in article.
Please ask away.
Beta Was this translation helpful? Give feedback.
All reactions