dsnote icon indicating copy to clipboard operation
dsnote copied to clipboard

Accented characters not displaying correctly

Open pixelbreeze38 opened this issue 1 year ago • 9 comments

I've noticed an issue where accented characters are not being correctly inputted when sending text to the active window. Characters without accents are processed fine, but accented characters like 'ã', 'ê', 'á', do not appear as expected in the application.

pixelbreeze38 avatar Feb 29 '24 15:02 pixelbreeze38

Thanks for reporting.

It should work but you have to have appropriate keyboard layout installed in your system.

It is not documented, but to make "sending text to the active window" functional, your keyboard must be able to generate characters you want to send. For instance to send Greek characters you need to have Greek keyboard layout installed in your system. You can check current layouts with following command:

setxkbmap -query

What language you have set in your system and what language you use for STT?

mkiol avatar Mar 01 '24 12:03 mkiol

Thank you for your quick response. I use Portuguese for STT. Here's the output of setxkbmap -query on my system:

rules: evdev model: pc105 layout: br,us variant: ,

pixelbreeze38 avatar Mar 01 '24 14:03 pixelbreeze38

Can confirm. It doesn't work.

This feature ("sending text to the active window") is implemented in such a way that the application imitates pressing a virtual keyboard. This makes it possible to insert any text outside the application. The key problem is finding the right combination of keystrokes to get the character you need. This is trivial for English because English characters map almost 1-1 to real keys on the keyboard. It's more complicated when you want to find a combination of characters that don't exist in English. Typically, you use Left Alt+<something> to create a modified latin letter. For example, to get ó, you type Left Alt + o (PL layout). This mechanism is implemented and works fine, but other combinations are not supported right now.

Using Brazilian keyboard layout, how can I type these characters? I mean what is the right key combination?

  • ã
  • ê
  • á

mkiol avatar Mar 01 '24 15:03 mkiol

To type the accents you asked about on a Brazilian keyboard:

  • ã: Press ~ then a.
  • ê: Press Shift + ^ then e.
  • á: Press ´ then a.
  • à: Press Shift + ` then a.

The tilde, circumflex, acute and grave accents act as dead keys, waiting for the next character to be pressed.

pixelbreeze38 avatar Mar 01 '24 17:03 pixelbreeze38

Thanks for the explanation. This is much more complicated than I anticipated!

I did quick research and I think I will be able to fix this :)

mkiol avatar Mar 02 '24 14:03 mkiol

That’s great! Excited to use this feature in Portuguese. Thanks!

pixelbreeze38 avatar Mar 02 '24 18:03 pixelbreeze38

Fix: 60f15d6

The fix will be included in the next release.

mkiol avatar Mar 02 '24 19:03 mkiol

Just letting you know if you want to test it before the release. The fix is included in beta version in flathub-beta.

mkiol avatar Mar 25 '24 19:03 mkiol

The fix works like a charm! Thank you!

pixelbreeze38 avatar Mar 26 '24 19:03 pixelbreeze38

Fix is included in v4.5.0.

mkiol avatar May 22 '24 05:05 mkiol