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

Issue with Key Up Key Down events in test application #152

Closed
GeoGegl opened this issue Jan 26, 2024 · 10 comments · Fixed by #153
Closed

Issue with Key Up Key Down events in test application #152

GeoGegl opened this issue Jan 26, 2024 · 10 comments · Fixed by #153

Comments

@GeoGegl
Copy link
Contributor

GeoGegl commented Jan 26, 2024

Summary
In the test application "WpfApplication.exe" in the "Keyboard Controls" tab,
the Keyboard Down Events label does not work for some keys. E.g. Arrow Keys
(The Keyboard Up Events work)

Steps to reproduce

  • Go to the "Keyboard Controls" tab in the test application "WpfApplication.exe"
  • Select input field
  • Type keys: A, B, C
  • observe Keyboard Down Events label and Keyboard Up Events label
  • Type the arrow keys on the keyboad: Left, Right, Up, Down
  • observe Keyboard Down Events label and Keyboard Up Events label

The Keyboard Up Events displays everything correctly for me.
Did anyone else experience this behavior?

I wrote a test case to check the behavior.

I used the latest release 3.0.0

@GeoGegl
Copy link
Contributor Author

GeoGegl commented Jan 26, 2024

I also saw the Press Key issue: #67
It is most probably related...

I created a pull request (my very first im my life):
#153

@Nepitwin
Copy link
Member

@GeoGegl

Thanks for you PR i think this shows the issue here in detail. Yes Issue 67 was about unity that keyboard events was not triggered.

We only send all command to FlaUI C# Keyboard implementation. I will recheck if any bug on robotframework wrapper side is made.

From issue 67 the last information was that the Keyboard implemention from FlaUI has to be adjusted probably a fix is done because i not recheck the library changes.

  • Recheck Robotframework-FlaUI if any wrong data is send to FlaUI Keyboard
  • Recheck FlaUI if a bugfix exists by Keyboard usage

@noubar
Copy link
Contributor

noubar commented Jan 29, 2024

i have retested WPFtestapp manually with the keyboard it seems the app itself has some issues.
The down button is not showing the arrows even when i am typing with keyboard manually.
I suggest also that we look for the source code of the test app

@noubar
Copy link
Contributor

noubar commented Jan 29, 2024

Reproductions steps are.
Open WpfApplication.exe
Go to keyboard Controls tab
Press and release 'a': everythin works fine
Press and release 'down arrow': still works fine
Press and release 'up arrow': the keyboard up event showing fine but keyboard down is not showing.

@Nepitwin
Copy link
Member

Nepitwin commented Jan 30, 2024

After verification and mentioned noubars text. OnKeyDown event is only triggered once by key operations.

Current implementation handles all keyboard interaction by window from test application.

But i found a wpf issue here : https://stackoverflow.com/questions/1646998/up-down-left-and-right-arrow-keys-do-not-trigger-keydown-event

Currently it's shows that the wpf testing application contains a bug on this side.

Nepitwin pushed a commit that referenced this issue Jan 30, 2024
@Nepitwin
Copy link
Member

@GeoGegl Can you pls take changes from branch bugfix/#152

I adjusted the wpf test application to handle events correctly. But i see in your test case that the expected input by release_only is wrong by your test case pls adjust them.

@GeoGegl
Copy link
Contributor Author

GeoGegl commented Jan 30, 2024

Thanks a lot! I'll work on it ASAP

@GeoGegl
Copy link
Contributor Author

GeoGegl commented Feb 2, 2024

I updated to ignore case in the key up / down test case.
And I also did a change on the WPF application.
I took over your PreviewKeyDown / Up entries but changed the behvior of
displaying the events in the WPF application.
As I'm new to github I'm not sure: Can you see my changes in the pull request?

What do you think about the changed event displaying?
My intention was to display all key down events until the keys are released.
And to display all key up events when they occur until no key is held down anymore -
only then a new list of key up events is displayed.
-> My test case does not cover all of that - but I guess it should be added in future

@noubar
Copy link
Contributor

noubar commented Feb 3, 2024

I think you have done it very well
Make the small changes @Nepitwin has asked in PR review.
Then we can merge into the main

My concern is though this press_only or up_only feature currently works only with keys starting with s'SOMEKEY' but not with text t'SOMETEXT'. And there is no code implemented to prevent it. As example error message saying you cannot use press_only or up_only feature with text.

@GeoGegl
Copy link
Contributor Author

GeoGegl commented Feb 4, 2024

Thanks for your input. I added the check and error message for text pattern and updated the changelog.

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

Successfully merging a pull request may close this issue.

3 participants