wgpu-py icon indicating copy to clipboard operation
wgpu-py copied to clipboard

Figure out how to handle unicode char events

Open almarklein opened this issue 1 year ago • 0 comments

Context

The current key events are focused on detecting key presses. They can be used to detect the user writing text, but only for Latin characters. It's not possible to detect a user typing ë or Chinese characters. This has not been a problem, but once we look into gui elements that receive text input, it is.

The solution to this problem should work across all supported GUI backends, so that code that uses it remains portable.

Temporary solution

In #516 this is solved with a new "char" event, that's fed into imgui. This is implemented for Qt and glfw, but not in jupyter_rfb. This event is not documented at the moment, and we should probably avoid using it for the time being, except for code that uses imgui, but that will be desktop until this issue is resolved.

Technical solution

@panxinmiao has already implemented a way to make this work for glfw and Qt.

A solution for JS would probably involve the input event, maybe via a hidden <div contenteditable=true></div>.

API options

A separate char event as we have now, or maybe it can become part of the current key event?

almarklein avatar Jun 21 '24 08:06 almarklein