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

Linux robot.Type() not working #52

Open
ProIntegritate opened this issue Jan 2, 2024 · 3 comments
Open

Linux robot.Type() not working #52

ProIntegritate opened this issue Jan 2, 2024 · 3 comments

Comments

@ProIntegritate
Copy link

ProIntegritate commented Jan 2, 2024

So, found your project, looked interesting. I did the standard example with robot.Type("Hello world!") in a .NET 6 project. On Windows it works fine, but on Linux nothing happens. It doesn't write to either the current console window or an instance of GEdit that i started to test it out.

I did have some problems with x11.os not being included, but i copied it manually to the Linux folder + also did a Selfcontained distribution - but neither worked. Running with .NET 6.0.25 installed under Ubuntu.

@ProIntegritate ProIntegritate changed the title Linux: "x11.os" missing. Linux robot.Type() not working Jan 2, 2024
@ProIntegritate
Copy link
Author

Apparently, On Linux .Type() only works in a web browser like Firefox and can't be used in a Terminal Window or other GUI application.

Also .KeyDown() .KeyPress(), .KeyUp() and .CombineKeys() does not work at all on Linux, only .Type() works meaning it is impossible to send ALT+TAB to flip between applications.

@olivercoad
Copy link
Contributor

Apparently, On Linux .Type() only works in a web browser like Firefox and can't be used in a Terminal Window or other GUI application.

Type() works fine for me in a Terminal Window and other GUI applications... what have you tried testing and what is your environment? Can you provide sample code to help reproduce your issue?

KeyDown/KeyUp/CombineKeys also do not work for me on linux. I never ended up getting around to adding unit tests for it in the TestApp, so for all I know perhaps they never worked on Linux.
KeyPress/Type do work for me though, and also have passing tests in the test app. @ProIntegritate could you please run the test app and paste the console output here? (Just cd into Desktop.Robot.TestApp then dotnet run and click the button. You should remove the "Can scroll vertical" test case from MouseTests.fs:113 first though as it's currently failing by scrolling hundreds of times causing it to time out).

Also what is your desktop system info? Can you paste the ouput of dotnet --info?

@ProIntegritate
Copy link
Author

ProIntegritate commented Jan 10, 2024

The code is pretty much a copy paste of the example on the github page ( https://github.com/lucassklp/Desktop.Robot ) under the section "Example of use". Basically i'm just using .Type() to get some output into the currently selected Window.

For this project I'm using .NET 6.0 and I'm using Ubuntu 22.04 (LTS) under VMWare Workstation, not sure if Gnome has something to do with it. Or VMWare.

Here is a video showing what happens: https://www.youtube.com/watch?v=lxFrrgXxGAY

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

No branches or pull requests

2 participants