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

winit integration #117

Closed
mwcampbell opened this issue Jul 20, 2022 · 4 comments
Closed

winit integration #117

mwcampbell opened this issue Jul 20, 2022 · 4 comments

Comments

@mwcampbell
Copy link
Contributor

Some popular Rust GUI toolkits and game engines use winit, so we need an easy way for winit-based applications to use AccessKit.

On Windows, the issue is that winit doesn't currently provide an official way for users to handle custom window messages such as WM_GETOBJECT. Possible fixes for this have been discussed on rust-windowing/winit#2120, but nothing has yet been implemented. That's not a complaint; I'm sure everyone working on winit is busy with other things. But I need to implement a solution soon. So I'm going to use a Win32 API technique called subclassing to override the window procedure with our own message handler. I'll implement this in the accesskit_windows crate, then I can add an accesskit_winit crate.

@mwcampbell
Copy link
Contributor Author

I implemented Win32 subclassing in #118.

@mwcampbell
Copy link
Contributor Author

My new winit adapter is in the winit branch under platforms/winit. I'll submit a PR once #120 is reviewed.

@maroider
Copy link

maroider commented Jul 22, 2022

The use of a T: From<ActionRequestEvent> bound on the ActionHandler impl for WinitActionHandler<T> honestly surprised me (in a good way, of course). The API quite reasonable to me, given the current state of Winit.

@mwcampbell
Copy link
Contributor Author

I just published the accesskit_winit crate on crates.io. So I'll close this, and open separate issues for any problems that arise in real-world usage.

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