pyautogui on Container can't Control Mouse - linux

I'm trying to automate mouse and keyboard using pyautogui on linux container on my chromebook (official linux support) however, the mouse and keyboard are not responding to any function (moving, clicking, pressing keys ....) yet something like pyautogui.alert('This is the message to display.') works and pop up a window.
Is there anyway to make it work on the container?

It has been more than a year since this question was asked, and there still doesn't seem to be any answer... I can confirm that this pyautogui problem still exists. One clue, perhaps, is the error message produced if an attempt is made to run under sudo like this:
sudo idle [python program that controls mouse]
This generates the error message:
_tkinter.TclError: couldn't connect to display ":0"
Some folks seemed to suggest that an appropriate EXPORT statement might help this problem, but I couldn't determine the exact details...
I really hope there is some solution/workaround for this problem since manipulating the mouse & keyboard is critical in many applications!

Related

How do I prevent my computer screen display to change when I try to bring a cygwin window?

I am a regular cygwin user, but since I added the curl functionality to my cygwin program, everytime I click on the cygwin icone, I get a change of screen color. The first image is what happen when I click on the cygwin icone.
the second image is how my screen should look like.
If you have a problem noticing the change of color, you could take a look at the windows icone on the bottom left of each image which appears different for each image while it should not.
Does anyone have an idea on what might have caused this, and how it could be fixed.
I also tried to find a similar question on stackoverflow but couldn't. Please let me know if you know a similar one where I might be able to get some help.

webdriver for node.js: execute scripts locally without relinquishing mouse and keyboard control?

Intermittent Failures with webdriver.js
I am creating some webdriver.js* scripts to automate some time consuming test setup activities. However, when I run the script and do other things with my keyboard and mouse, I come back and find that, intermittently, a particular element cannot be found. And it's a different element each time.
When I run the same scripts and just watch them run, the scripts execute correctly.
Also, when I researched this potential problem, I came up with lots of stuff on using the mouse in webdriver scripts and problems with the click method itself but couldn't find anything to do with my issue. So I'm wondering whether I'm just doing something wrong here.
So What's The Question?
My question is: Is webdriver.js not meant to run like this? (that is, run locally while the keyboard and mouse are doing other things)?
Webdriver.py?
I don't remember having these problems when I used webdriver.py a few years back. iirc, I was able to run the scripts while the workstation was locked (via Win + L) though my memory isn't what it used to be ;)
I would use webdriver.py, however, no one else in our team knows python so I thought I would go webdriver.js since we all know javascript :)
Params: IE11, Windows 10.
* Also, when I say "webdriver.js", I mean the webdriver that is installed after following the steps here
I found that if I replaced the .click() calls with an equivalent .sendKeys() call (e.g. webdriver.Key.ENTER / webdriver.Key.SPACE) , this would get around the problem. I could even lock my workstation and the scripts would run without any problems.

Python 3 & Tkinter buggy and slow

So, a few months back I made a small GUI for handling NPCs in a roleplaying campaign I was running. I haven't touched in since then, except that now I need it! Tomorrow, in fact...
I have a few odd error... Loading the GUI seems to work fine, but when I start to press buttons the troubles start. It seemed, at first, that it the script was very slow, which it shouldn't be, calling a two line dice function on a button press. I accidentally figured out that when I hover the mouse over the "close/minimize window" buttons (not in the GUI, but in the OS), the button would update with the result of the button press.
The same thing happens with a listbox I have: choosing an item may or may not select the item straight away (but hovering over the close/minimize updates it), and the results of the selection may or may not show. The results is in fact weirder: selecting a listbox item is supposed to get info from the selected item and print it in another frame. Even if the selection itself is fine without hovering, the printed text is somehow "clipped", showing only an area seeming to cover an arbitrarily sized square of text... Remedied by hovering, of course. The rest of the GUI have the exact same problems.
I have no clue what is going on here. The script was written on another computer, but that was also a Mac running the same OSX version (Mavericks), and it was a MUCH slower computer. This script shouldn't need any sort of advanced specs, though! I'm guessing it's something wrong with migrating to the new computer and the various version of different software? I'll paste the script down below, in case that'll help somehow.
Any help would be greatly appreciated, especially if it comes before the next epic campaign of Superheroes starts tomorrow afternoon! =P
[UPDATE]:
It was some time ago, but I still would like to have this problem solved. I've reduced my script to just a simple button, and the problem persists: clicking the button, even though there is no function or anything associated with it, only results in the frozen "button-clicked"-colour (i.e. light blue on OSX Yosemite), and I have to hover my mouse pointer over the close/minimize/etc. buttons in the top left corner to make it go back to "idle-button"-colour (i.e. grey).
#!/usr/bin/python
import tkinter as tk
root = tk.Tk()
test = tk.Button(root, text='test')
test.pack()
root.mainloop()
So, the problem obviously isn't with any of my "downstream" scripting, but something with the module or my way of calling it. Calling the script for the Terminal doesn't give me any error messages, and the problem is still there. Any ideas? It would be really, really good to get to the bottom of this problem!
I had the same problem when using Tk 8.5.13 on Mac OS X Sierra (10.12.3) with Python and IDLE v3.6.0.
Upgrading to TCL/Tk 8.5.18.0 as recommended on the Python Software Foundation page https://www.python.org/download/mac/tcltk/#activetcl-8-5-18-0 seemed to do the trick. This was the recommended version for my edition of the OS.
The interface I was building starting responding as I would expect, i.e. straight away when one of the controls was used. The only reservation I have so far is that normal buttons don't seem to have any sort of animation now, although the buttons do actually work.
-S.

Linux terminal with full keyboard support?

I made a text editor and I want to port it to Linux such that I can use it remotely via SSH. I don't know much about Linux terminals, so maybe I'm missing something obvious, because I just can't believe that in 2013 there's still no way for a remote terminal to distinguish between Ctrl+M and Enter, or between Ctrl+H and Backspace, or even get any events at all for Ctrl+Left/Right/Up/Down, and so on. I tried ncurses and libtermkey to no avail. The question is, is there any effort or discussion in the Linux community on modernizing or replacing the linux terminal protocol(s) to something that supports full keyboard and mouse interaction and possibly full color, i.e. something that would allow for text user-interfaces without huge usability compromises?
As far as I know, the Linux console terminal just doesn't support this, full stop. If you want to try raising a patch, you could have a go at implementing the full CSI-encoded reporting scheme. It is documented here.
libtermkey will recognise the key sequences if sent, but the fix has to go into the terminal first of all to send them in the first place.

Browser issue with constant refresh when typing in text field

This is more of a computer question than a programming question and it I am posting in the wrong place, please let me know. My system is running Windows 8, 64bit. Regardless of which browser I use - IE or Chrome, every time I attempt to type something into a text field, the screen refreshes. I have also noticed that the refresh symbol starts to flash. I can get that to stop by pressing the ESC key, but then the screen goes blank. I have done a complete scan of my computer and found no viruses. Any ideas would be great appreciated as this is making things very difficult, including typing this message.
I uninstalled and reinstalled and that seemed to fix the problem.

Resources