Bloc icon indicating copy to clipboard operation
Bloc copied to clipboard

BlMorphicEventHandler cannot handle "handleTextEditionEvent:"

Open Nyan11 opened this issue 1 year ago • 0 comments

Hello,

I found a missing handler on the BlMorphic handler that can open a debugger.

See video:

https://github.com/pharo-graphics/Bloc/assets/34318678/ffb1b98d-de40-43b1-b625-2cdb038ab2b1

To reproduce

  • Open any BlSpace with a BlMorphicHost. For example:
BlMorphicHost example
  • Unfocus the window (by closing it for example).
  • Refocus the window with the cursor on the BlSpace (i do this when i open the window with the Pharo launcher).

In this video, i show the editing text event trigger when the window is unfoccus:

https://github.com/pharo-graphics/Bloc/assets/34318678/dce5ff82-b8c6-41f4-ae7f-b6479b2f1aa1

Explication

When a SDL window is unfoccus, at least in Windows10, SDL send a SDL_TextEditingEvent. And BlMorphicHost cannot handle this event.

  • SDL = Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL/Direct3D/Metal/Vulkan. (https://wiki.libsdl.org/SDL2/FrontPage).
  • SDL_TextEditingEvent = Event for special characters (chiness, japeness, korean) (See on the spot: https://www-archive.mozilla.org/projects/intl/input-method-spec.html)

How to fix

Create an empty handler for text editing event. This solution will probably not support special keyboards (korean, chiness, etc).

I also check for the BlOSWindowSDL2Host. The events manager for this host is BlOSWindowEventHandler, and it manage the TextEditingEvent in the method #visitTextEditingEvent: (from the superclass: OsWindowEventVisitor). The method is empty, so it probably does't handle special keyboards. I did not manage to test it.

Other informations

Pharo 11.0.0 Build information: Pharo-11.0.0+build.710.sha.ea28d8552cac85a7ce1e9c34ab1e7bd45f7b9910 (64 Bit)

Bloc version: ea7c92c - 17/10/2023

Nyan11 avatar Oct 19 '23 14:10 Nyan11