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

impl NSTextInputClient #542

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

Hperigo
Copy link

@Hperigo Hperigo commented Aug 1, 2021

the PR implements the NSTextInputClient ( #460 ) for MTKView and NSOpenGLView, this will allow _sapp_macos_app to receive key code for characters like á, é, í, ó, ú

a couple of notes:

  1. the _sapp.event.char_code is set inside insertText method. _sapp.event.modifiers and _sapp.event.key_repeat are still inside keyDown I'm not sure if this is going to break something, but it looks correct.
  2. As suggested in the original feature request ( [Feature Request] - Support accented characters (non-us keyboard) on MacOS and Linux #460 ) this impl. is similar to the GLFW, the main difference is that firstRectForCharacterRange is returning return NSMakeRect(0.0, 0.0, 0.0, 0.0);. the original impl uses the window bounds, I'm not sure what is the difference here..

This is my first PR here, so feel free to point any corrections, etc.. =)

@floooh
Copy link
Owner

floooh commented Aug 3, 2021

I need to read up on the macOS APIs to provide better feedback, but one dangerous thing I noticed while looking through the changes is that your PR undoes the following bug fix:

b326f33

Not sure how this can happen TBH.

@floooh floooh marked this pull request as draft August 3, 2021 17:21
@floooh
Copy link
Owner

floooh commented Aug 3, 2021

(I changed the PR to a draft so that I don't accidentally click the merge button)

@Hperigo
Copy link
Author

Hperigo commented Aug 4, 2021

I'll double check the b326f33 that you pointed, I think that's was a mistake on my end..

please feel free to provide any other feedback =)

@eduardodoria
Copy link

I changed #460 because it is not working on Linux (Ubuntu 20.04.3 LTS) too.

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.

None yet

3 participants