bgrabitmap / lazpaint

🎨 Cross-platform image editor with raster and vector layers similar to Paint.Net written in Lazarus (Free Pascal)
https://lazpaint.github.io/
GNU General Public License v3.0
401 stars 55 forks source link

Can not enter a text with '€' symbol #536

Closed Lulu04 closed 2 weeks ago

Lulu04 commented 1 year ago

Hi, first, thanks you for BGRABitmap and LazPaint ! A small bug prevents from entering the symbol of euro € with the Text command and, instead, the export window opens. My keyboard is AZERTY (french), on Windows 10 64b, Lazpaint 7.1.4 64b

How to reproduce: 1 - on a new image, click the Text button and draw a rectangular area 2 - press AltGr+E to print '€' -> this open the export windows

Regard

EDIT: tryed with the last version of Lazpaint 7.2.2 and the problem still exists.

fredvs commented 1 year ago

Hello.

2 - press AltGr+E to print '€' -> this open the export windows

Hum, strange because the shortcut to export windows is Ctrl+E (not AltGr+E). Tested on Linux and it works as expected. I will try asap on Windows 11.

fredvs commented 1 year ago

Re-hello.

Tested LazPaint32 Windows version via Linux-wine and there, all OK, AltGr+E gives .

But booting the same machine on Windows 11, there is indeed a problem with AltGr+E. Here it does not show the export windows but it minimizes the main LazPaint form and without adding the symbol...

Aie, very boring problem...

Maybe you could use a workaround, like copy € symbol with Ctrl+C from somewhere, like notepad, and paste it with Ctrl+V in the LazPaint text editor.

Lulu04 commented 1 year ago

Thank you Fred for your answer. Yes Ctrl+C workaround work well. Tested Lazpaint 2.2.2 on windows 7 machine, 32b, and it does the same: while editing text on the image, AltGr+E open the Export window, € is not inserted in the text.

Lulu04 commented 1 year ago

After some test on Lazarus 2.2.4 Win 64, it appears that a press on AltGr trigger TWO TIME TForm.OnKeyDown event:

First: with Key = VK_CONTROL, shift = ssCtrl. second: with key = VK_MENU, shift = [ssCtrl, ssAlt] Application.ExtendedKeysSupport := True/False don't change anything.

On my win32 machine, Lazarus 2.2.4, same behaviour: OnKeyDown is triggered two time with same value above.

maybe this is a clue for the solution to this problem.

Regards

fredvs commented 1 year ago

Hum, indeed something is strange there. Notre that I tested Lazarus and in the code-editor AltGr+E gives the €. So it seems it is not related to LCL ( I did not test yet a simple Lazarus-LCL application, with a TEdit for example, should be interesting to test the result ).

circular17 commented 1 year ago

This is strange indeed.

A workaround is to hold ALT and type 0128 with the pad. 128 is the value of € in the Windows-1252 codepage.

circular17 commented 2 weeks ago

AltGr opens the export window because the menu is set to trigger with Ctrl+Alt+E, and AltGr is treated as Ctrl+Alt. I've implemented a fix that detects when Ctrl and Alt are pressed simultaneously, identifying it as AltGr instead.