-
Notifications
You must be signed in to change notification settings - Fork 46
Provide feedback for the arrow keys in the Virtual MIDI Keyboard. #1215
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
Conversation
Trying this build on Windows with NVDA to start with, I don't hear anything reported when hitting arrows in the VKB yet, same with or without Shortcut Help. What did I miss? |
I... have no idea. It should just work. Does the vkb open as soon as you press alt+b? Does NVDA+tab say "Virtual keyboard keys grouping"? |
Yep to both questions. I've made sure it's not docked and isn't obscured by any other windows or floating thingies, still nada. Weird! |
Let me know if the next build improves things. |
That's got it going yep. Lovely stuff! @jennykbrennan can you check this out on Mac and report back? |
Right. Where should I start. I gave it a spin on windows and all works a charm. |
Damn.
Can you clarify which bits are regressed specifically by this PR? That is, in what ways (if any) does this PR make things worse than the release snapshots? I'm wondering whether we can merge this for the benefit of Windows users, given that vkb is clearly very broken on mac already anyway. |
Hmm sounds like REAPER's not supporting arrows the same on Mac doesn't it. Hang on for a while before merging, I'll investigate and ask Cockos to do a fixy if needed. Would be nicer to say "requires version whatever on Mac" than "uh, sorry Mac peeps". |
I'll give it a slightly more scientific test and report back in a few with more detail. An yeah, this might be one of those, sorry Mac folks moments. For a while anyways. |
And here I was happy that I managed to come up with a way to (supposedly) do this cross-platform without too many horrible hacks. 😢 |
Oh, how we love Apple. |
In this PR With osara_2025.3.14.1846 Right, so with my system and how it is, merging would make it plenty better for Windows users, and a bit better for mac users than it currently is. |
Are you sure the track was armed every time you tested Shortcut Help in the VKB? That could explain why speaking note names wasn't happening. |
yeah, I did insert virtual instrument on new track, ran reasynth. Definitely armed as I checked again now just in case. |
I'm not seeing what Jenny is experiencing here (Reaper 7.34 on Mac OS 15.4 Beta). With the keyboard help on if I press the arrow keys I hear the announcements about channels and octaves, at least when the keyboard itself has focus. A separate issue which is on Reaper is the keyboard itself is one of those controls that, like a lot of sliders, doesn't send a focus notification when you tab through the dialog instead of using the VO cursor, but the window opens with the keyboard in focus and OSARA is doing what it should at least here. |
Yeah, interesting. What is happening here is very strange and I'm not beyond believing that it's my machine that is acting up. Very strange symptoms though and I can't say what would make it do this. But I'll do a proper check and a restart to see if I can get it to behave. Mostly for my own curiosity now. I really don't think I can trust my machine in this case. It's been overall rather unreliable lately. |
@ScottChesworth, thoughts on merging? |
Figured out what was up with Jen's settings, can be avoided in future by adding three things to optimal config. I'll send a PR over the weekend. However, there are still inconsistencies comparing Windows and Mac described in nexdt comment. |
Some gotchas/differences I noticed comparing Windows and Mac:
|
Right, so this isn't going to be a cross-platform thing. I've written this code about as cross-platform as I can, so if it isn't working, REAPER must be doing something different on Mac. I can't fathom what.
I don't even see a way to check that box without using screen reader specific commands.
Wow. Is that new? I haven't updated REAPER for a bit, but I don't have that option here.
That is... a little tricky. I'll see what I can do. |
The upcoming build fixes hooking of the arrow keys when the check boxes have focus on Windows. It's slightly possible this might help things on Mac too, but I doubt it. |
It's very excellent on Windows! One last check nothing got hosed on Mac then merge I reckon. |
When opening vkb, doing nothing else, arrows change octave/channel but doesn't report. |
I managed to drum up the fortitude to do some debugging on Mac. It turns out that when the vkb window first gets focus, despite what VoiceOver reports, the check box isn't actually the thing that has focus. Instead, it's the control for the keys themselves, which (as @pitermach points out) doesn't report anything with VO. However, on Windows, that control is a child of the vkb dialog and has a window class name. On Mac, there is no child window - it just reports as the dialog itself - and the dialog has no window class name. I guess there's something quirky going on with the SWELL emulation layer here. Anyway, it turns out that hacking around that wasn't too hard; it was just painful to debug, especially as I hardly know how to use a Mac. |
Nice! I couldn't tell there was an equivalent control on Mac here. Would love to hear about how you debugged this if it's easy to explain? |
Figuring out that there was a specific problematic control was mostly a process of deduction:
Figuring out the fix involved shoving a lot of debug console messages into the code. I established that the problematic HWND had no class name and that its parent wasn't the vkb window. I nearly gave up at that point, since I figured I had nothing to work with to detect it. But on a final hunch, I started printing the pointer addresses for the HWND and its parent, then looked at the output for both the working and non-working cases. I was able to spot then that the HWND in the non-working case had the same memory address as the parent HWND (the vkb container window) in the working case. From there, the fix was simple: compare both the HWND itself, as well as its parent, against the vkb window. |
One bug I'll flag here (because it took me a while to figure out wtf was going on) is that if you start REAPER with the vkb already open, this new OSARA reporting won't work at all until you restart REAPER. This will happen if you exit REAPER with the vkb open; that window state gets saved. That's fairly difficult to do on Windows because alt+f4 (the most natural way to close an application) closes the vkb. However, on Mac, command+q will quit REAPER with the vkb still open. I think the reason is that REAPER registers its own keyboard hook for the vkb the first time the vkb opens in a given session. If REAPER registers its hook before OSARA can, since hooks are processed in the order they're installed, OSARA's hook never gets called. To make matters worse, it seems that REAPER keeps its own vkb hook registered even when you close the vkb; I have to keep OSARA's hook registered forever to work around that. That's why closing and reopening the vkb doesn't fix this situation and you have to restart REAPER. |
Thanks heaps for explaining. We tried hitting tab when we were testing on Jen's Mac, but when we heard nothing, I assumed too soon that tabbing wasn't gonna do anything useful in that window. Duh! I've seen blank spots in tab orders plenty of times, never occured the same might happen in a SWELL GUI. |
So if I ask Justin to tidy up the labelling to be more like the Windows VKB, will it break what you've done here? |
I honestly don't know. Also, I might have a fix for that bug I mentioned above. |
Ooh, Excellent! I hope you treated yourself with a nice cold happy brew of some sort after that, @jcsteh What a nightmare. |
Fixes #1214.
@ScottChesworth, please take this for a spin and let me know what you think.