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

Accents still not work in text tool on Linux #61

Closed
antrrax opened this issue Sep 7, 2019 · 14 comments
Closed

Accents still not work in text tool on Linux #61

antrrax opened this issue Sep 7, 2019 · 14 comments
Labels
bug Something isn't working

Comments

@antrrax
Copy link
Contributor

antrrax commented Sep 7, 2019

I use Linux Mint 19.2 x64 Cinnamon
Git clone: September 06, 2019

I did the accent test and it's still not working. I tested on the same PC with Windows 7 and Linux Mint Cinnamon and tested on another PC with Windows 10

On both Windows 7 and 10 in the Ksnip textbox tool, the keyboard appears to be set up correctly, but does not accept accents above the letters.
In Windows if I type "Alt Gr" + "Third character keys", nothing appears in Ksnip

(In other Windows applications the keyboard is normal)

windows


In Linux Mint Cinnamon in the Ksnip textbox tool, the keyboard does not appear to be configured for the Brazilian Portuguese layout, as no accent key works, but I noticed that if I type the {"Alt Gr" + "accent key"} or {"Alt Gr" + "Shift" + "accent key"} Ksnip displays the accent, however the accent is never above the letters. (In other applications the keyboard is normal)

linux

kb

$locale

LANG=pt_BR.UTF-8
LANGUAGE=pt_BR
LC_CTYPE="pt_BR.UTF-8"
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_COLLATE="pt_BR.UTF-8"
LC_MONETARY=pt_BR.UTF-8
LC_MESSAGES="pt_BR.UTF-8"
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8
LC_ALL=

@DamirPorobic
Copy link
Member

Now I get you, you would expect to type something like this é.
I think it doesn't have to do anything with your keyboard but rather with the way we detect key press in order to write the text in the text item, need to look into that in more detail.

@DamirPorobic DamirPorobic added the bug Something isn't working label Sep 7, 2019
@antrrax
Copy link
Contributor Author

antrrax commented Sep 7, 2019

The expected behavior is that the accents are typed over the letter, and for that to happen the default is 1st we type the accent key and then the letter key. For example:

á à â ã ä

But the strange thing is that on Windows and Linux the keyboard behavior was different
The default is to NOT have to type the "Alt Gr" key to have the accents.

@antrrax
Copy link
Contributor Author

antrrax commented Sep 9, 2019

I did the test with version 1.6.0 - 09/09/19. On Windows 7 and Windows 10 the accents are working correctly.
But on Linux Mint still didn't work, I tested the .deb version and the appimage version.
I tested on another PC with Linux mint also did not work

Note: Windows 7 and Linux Mint are on the same hardware.

@DamirPorobic
Copy link
Member

Ok, that's something. I've just tested in a normal Linux text editor (Kate on OpenSUSE) and there I can't input accents too. Is it anywhere possible on Linux by default? Same here in this text on Github in a Firefox Browser, the usual way how I enter accents doesn't work.

@DamirPorobic DamirPorobic changed the title Accents still don't work in text tool Accents still not work in text tool on Linux Sep 10, 2019
@antrrax
Copy link
Contributor Author

antrrax commented Sep 11, 2019

I installed OpenSUSE to do some testing.
When the keyboard is set to Layout English US. In the text editor Kate, I can not type the accents on the letters see in the image:
kate-en

When I changed the keyboard to Layout: Portuguese BR, then I can type the accents on the letters as it should be.
kate-pt

NOTE: I did the same test on Linux Mint Cinnamon and the behavior was the same - on the english keyboard layout it was not possible to type the accents on the letters

Yast:
yast-kb
pt


EN-US Keyboard Layout
KB-en-us

PT-BR Keyboard Layout
KB-pt-br

@DamirPorobic
Copy link
Member

Thanks for testing that. Strange, I have a German Keyboard and should be able to type the é or at least it work on Windows. Anyways, we need to investigate that further, need to check if we get the wrong Keys in the Key Press Event or we just pars them incorrectly.

@raphaelh
Copy link

raphaelh commented Jan 30, 2020

Hi,

I can report the same problem using Xubuntu 19.10 with ksnip 1.5.0:

image

I cannot type the following for example : ê ô ë ö

I'm available to help you debug this

@DamirPorobic
Copy link
Member

Thanks for reporting. I still haven't had time to look into this. Any RP are welcome.

@raphaelh
Copy link

raphaelh commented Feb 1, 2020

Any idea on how to help you debug this?

@DamirPorobic
Copy link
Member

Well, we currently use a keyPressEvent detect every single key pressed and from that we extract the letters that we insert in the TextItem. We first need to figure out if we can get the correct letter (the one with the accent) from the event, if yes, we need to check why we don't write it then. If not, we have two options:

  1. Create mapping for every combination of accent and letter, then check every time an accent is pressed what the next letter is and return an entry from the mapping. Could be difficult to track all accents and create the correct mapping.
  2. Inherit from QGraphicsTextItem, I believe they map correctly. Problem here is that our ItemBase class inherits already from QGraphicsItem, from which also QGraphicsTextItem inherits. We would need to check if we can extract our base functionality into it's own abstract class and let every itemType inherit from QGraphicsItem and only our TextItem from QGraphicsTextItem.

That's probably what I would do to investigate this.

@DamirPorobic
Copy link
Member

@antrrax you mentioned that its working on Windows but not on linux, right? This would mean or handling is not that incorrect, we need to find out where the difference between linux and windows come from.

DamirPorobic added a commit that referenced this issue Feb 2, 2020
@DamirPorobic
Copy link
Member

It looks like we have a solution for this, can you test again on your side? @raphaelh please test with latest version, not 1.5.0. The latest version you can find here https://github.com/ksnip/ksnip/releases/tag/continuous as soon as the build is done.

@antrrax
Copy link
Contributor Author

antrrax commented Feb 2, 2020

I tested it on Mint and now it's working properly!
Thanks

@raphaelh
Copy link

raphaelh commented Feb 3, 2020

It works perfectly, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants