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

[Mac OS port] Potential issues with keyboard modifier state #19

Open
Tracked by #21
jceipek opened this issue Aug 14, 2021 · 2 comments
Open
Tracked by #21

[Mac OS port] Potential issues with keyboard modifier state #19

jceipek opened this issue Aug 14, 2021 · 2 comments

Comments

@jceipek
Copy link

jceipek commented Aug 14, 2021

In my MacOS port, I've been noticing issues where the application didn't realize I was holding down certain modifier keys.
I believe the cause is that the modifier state isn't being appropriately synchronized here: https://github.com/dfeneyrou/palanteer/blob/main/server/viewer/vwPlatform.cpp#L642-L718

Note that the kms parameter is ignored in many of the functions in the file, which can lead to these imgui fields not being synchronized to the keyboard state correctly:

io.KeyCtrl
io.KeyShift
io.KeyAlt  
io.KeySuper

I also haven't been able to determine which osHandler->event* function would be best to call when responding to the NSEventTypeFlagsChanged event type on macOS. See https://github.com/ocornut/imgui/blob/0b8a2470743f89d19ab2d5920606434b604b529e/backends/imgui_impl_osx.mm#L342-L345 for how it is handled in the Dear ImGui example.

@dfeneyrou dfeneyrou changed the title Potential issues with keyboard modifier state [Mac OS port] Potential issues with keyboard modifier state Aug 17, 2021
@dfeneyrou
Copy link
Owner

See answer in #18 .
I cannot help for Mac OS related questions because I have no such environment at hand nor experience with it.
However, Dear Imgui contains valuable information for this kind of project in its various examples.

@jceipek
Copy link
Author

jceipek commented Aug 18, 2021

@dfeneyrou What are your thoughts on adding this? https://github.com/dfeneyrou/palanteer/pull/21/files#diff-2d88bc2cf5369b76a592e61c044242925375802ffdcbcbf8440711355359fe76R695-R707

And do you think it makes sense to add something like

     io.KeyCtrl  = kms.ctrl;
     io.KeyShift = kms.shift;
     io.KeyAlt   = kms.alt;
     io.KeySuper = kms.sys;

to all of the vwPlatform.cpp functions that accept kms parameters but ignore them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants