Skip to content

impl NSTextInputClient#542

Draft
Hperigo wants to merge 2 commits into
floooh:masterfrom
Hperigo:osx-keyboard-input
Draft

impl NSTextInputClient#542
Hperigo wants to merge 2 commits into
floooh:masterfrom
Hperigo:osx-keyboard-input

Conversation

@Hperigo

@Hperigo Hperigo commented Aug 1, 2021

Copy link
Copy Markdown

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

floooh commented Aug 3, 2021

Copy link
Copy Markdown
Owner

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

floooh commented Aug 3, 2021

Copy link
Copy Markdown
Owner

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

@Hperigo

Hperigo commented Aug 4, 2021

Copy link
Copy Markdown
Author

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
Copy Markdown

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.

3 participants