Interact window provides incorrect codes on keypress and keydown events #200
Labels
No labels
area/accessibility
area/dependency
Confirmed
Crash Report
Delayed
Design Issue
Duplicate
Feedback required
Good first issue
kind/bug
kind/cleanup
kind/enhancement
platform/linux
platform/macos
platform/windows
priority/high
Question
Request for Comments
Seeking Other Contributors
Seeking Testers
Won't Fix / By Design
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-obsproject/obs-browser#200
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Whenever a
keydownorkeypressevent gets triggered,event.codegets set to the wrong value.Expected Behavior
Add the following scripts and then hold down the A key when having any window selected. It should log
KeyAfor each of the events.Current Behavior
Add the following scripts and then hold down the A key when having the Browser Source Interact window selected. It logs
F7and an empty string for each of the events.Steps to Reproduce
--remote-debugging-port=8081so you have access to the debug tools.http://localhost:8081. Run the following script in the console:Additional information
event.keyCodeproduces the correct values, butevent.codeis broken for both thekeypressandkeydownevents.I can confirm this is an issue in browser sources.
Tested with: https://keycode.info
Findings:
There are a few possibilities
After doing some digging, this is primarily possibility 3, but not in the ways I expected.
This line needs to pull the
native_scancodefrom the event https://github.com/obsproject/obs-browser/blob/master/obs-browser-source.cpp#L303Modifiers are absolutely not passed correctly. We'll likely have to read the modifiers and convert them to event flags: https://github.com/Dax89/QtCEF/blob/master/QtChromiumPlugin/qquickchromiumwebview.cpp#L412
I will likely do more digging myself, but I'm providing this info to help others in case someone else is interested in trying their hand at fixing this.