Skip to content

Conversation

@timon-schelling
Copy link
Member

@timon-schelling timon-schelling commented Nov 12, 2025

and some other changes see commit messages

the texture import fix is only for mac.
they changed something about that while copying that code from us.
see tauri-apps/cef-rs#272 for details.

Closes #3336

tested on:

@csmoe
Copy link

csmoe commented Nov 13, 2025

Sending key event twice to cef on key press is already not that correct, isn't it? My webview wrapper just sent one event per press and it works fine on mac/windows. cefclient only does this whille handling ime related things https://github.com/chromiumembedded/cef/blob/7087113239f0ef0f929a9404b2807aa65d95b79e/tests/cefclient/browser/text_input_client_osr_mac.mm#L294.

@timon-schelling
Copy link
Member Author

I will take a look at your implementation.
Was never able to get cef to forward correct Inputs to the frontend without a key down event before any char event. (On windows)

Maybe I'm filling some fields differently (incorrect)?

But I'm pretty sure that there is a platform difference in some way. Especially with the option key on Mac.

Co-authored-by: csmoe <csmoe@msn.com>
@timon-schelling
Copy link
Member Author

Hey @csmoe just finished reimplementing Keyboard input using your webview impl as a guide.

I gave you Co-author on that commit.

I realized afterward that your code doesn't specify a license. If you'd prefer that the portions I was able to draw from not be merged into Graphite, I'll absolutely respect that. It's probably fair use, but I still want to check with you first.

@timon-schelling
Copy link
Member Author

@csmoe Your implementation is mostly correct for Mac but doesn't work for win and linux.
On mac both char and key down get mapped to NSKeyDown (there is no NSChar AFAIK). On win and linux both key down and char events are needed.

@csmoe
Copy link

csmoe commented Nov 14, 2025

Thanks, I'll check my implementation. By the way, how can I run the desktop app locally? I tried days ago, but failed.

@timon-schelling
Copy link
Member Author

Thanks, I'll check my implementation. By the way, how can I run the desktop app locally? I tried days ago, but failed.

Command would be npm run start-desktop for now.
Maybe come ask in the desktop-app channel on discord so we don't derail this.

could you also answer my license/attribution question?

@csmoe
Copy link

csmoe commented Nov 14, 2025

Feel free to use the code, I'm quite flattered.

@luca3s
Copy link

luca3s commented Nov 14, 2025

This isn't a regression in this PR, but the issue i mentioned in #3374, that on mac (with a german keyboard) the zoom in shortcut is cmd * still exists. It is correct in the way that the shown key and the key it reacts to are the same, but at some point this should probably be changed to + (while reacting to = physical code).

@timon-schelling
Copy link
Member Author

timon-schelling commented Nov 14, 2025

Also leaving this here for more context.

adding this in desktop wrapper fixes the not working CMD+'+' issue
but displays = like before.

Key::FakeKeyPlus => key = Some(KeyCode::Equal),

supporting custom display char requires one of three things

  • adding that as a feature to muda (lib used for menu creation on mac)
  • forking muda and using that
  • write custom NSMenu mapping code (interface with objc lib on mac directly, annoying but not impossible)

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 this pull request may close these issues.

Mac Alt+_ shortcuts don't work on desktop

4 participants