-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
enter_keys on macOS behaves in an odd manner #257
Comments
Looking into this a bit deeper I am wondering if this is not an enigo issue rather than a relm one!? |
It might also be a race condition with the way |
enter_key() funny enough does work. I did try it but ran into a problem with the ":" character, it keeps being sent as a ";" and that was when I tried enter_keys. I need the ":" character as it forms part of a time entry "hh:mm" This made me think about trying something else. For the colon ":" I have now landed up using a sequence of
which seems to work, certainly enough to work around the problem. Thanks for responding. |
I published Also, if you want to contribute to this project, you could try adding OS X to the platforms tested on GitHub CI ;) . |
Thank you, have updated and will test it when I get a chance this week. In principle I am keen to contribute but not sure my Rust is strong enough :-p but I will have a look at the Github CI stuff and see if I can contribute there... |
I did a quick check on the weekend and I am still getting that weird keys not being sent issue. I am going to dig into it a little bit deeper this week when I get some time and see if I can locate where it is going weird. Will see what I can find. |
Great work on relm, makes Gtk a pleasure to use with Rust.
I am raising this mostly for awareness and to see if anyone else is experiencing something similar. It is not holding up anything important.
I am working on a Rust/Gtk/Relm application on macOS and wanted to bolster the tests. Doing this so I can put on Github and will then send you a PR to include it if interesting.
I have been using code something like the following (this is a subset, hopefully enough to illustrate the problem). For reference the test code is located in the same file as the code that loads the screen layout from a .glade file.
Environment
macOS 11.1 - Big Sur
VSCode 1.52.1
relm 0.20.0
relm-test 0.20.0
gtk 0.9.0
gtk-test 0.6
rustc 1.50.0-nightly (same behaviour with stable 1.48)
What happens
I have noticed that on MacOS the first key entry '1' is sent to the Entry widget and then it appears as if code execution stops. If I press a key while in the Entry widget the next 'enter_keys' statement is executed and the key I have pressed are both sent to the Entry widget. I have seen the same behaviour in the key-events.rs example in the relm-examples package. I then performed the test on a Linux (Ubuntu 20.04) machine and it behaved as I would expect, all the keys were sent and each assert statement was executed as expected.
What was expected
The enter_keys function sends keys and continues.
As noticed by running the same test in the same app on an Ubuntu machine, the enter_keys function successfully sends the key and continues to the next statements and the test succeeds so it looks like it may be only applicable to macOS. I have not tested on Windows.
The text was updated successfully, but these errors were encountered: