I've added a github comment to the commit, which is perhaps
the right way to report a problem with a particular commit; see:
https://github.com/fltk/fltk/commit/1ae43956e2bfb933d63fc774ca8e4ed22e4108dd
On 9/2/24 11:54 Matt wrote:
> Thanks for the bug report. I am reversing the commit as I write this.
> I was not aware that "AltGr" on Windows is seen as FL_CTRL. So much
> for innocent changes.
@Matthias: I'm not sure if this report is "correct", there may be
another cause why the OP doesn't see the correct input text. First I
thought that my own keyboard patch would perhaps "fix" this issue as
well, but then I couldn't reproduce the OP's issue with my keyboard set
to Swedish. I see all AltGr+X characters entered as expected. We need
more info...
I just wanted to revert my changes ASAP because they currently did not really fix anything, but were required for some of Albrecht's private code.
In any case, we need to be super careful about any change in the keyboard routines, even if they seem benign. I assume we need to add some AltGr flag and more foreign keyboard handling at some point.
From GitHub 'master' (output is the same as from my WIP): [nnn] Event Key Name, Flags: C A S M N L Text Unicode UTF-8/hex [180] FL_KEYDOWN 0xffe3 FL_Control_L C . . . . . '' [181] FL_KEYDOWN 0xffea FL_Alt_R C A . . . . '' [182] FL_KEYUP 0xffe3 FL_Control_L . A . . . . '' [183] FL_KEYUP 0xffea FL_Alt_R . . . . . . ''I'm using this Swedish keyboard layout for reference:
*** Windows Swedish Keyboard (SV), branch master bevore revert (aa6ce6b9f) [ 1] FL_KEYDOWN 0x0079 'y' . . . . . . 'y' U+0079 79 [ 2] FL_KEYDOWN 0xffe3 FL_Control_L C . . . . . '' [ 3] FL_KEYDOWN 0xffea FL_Alt_R C A . . . . '' [ 4] FL_KEYDOWN 0x0071 'q' C A . . . . '' [ 5] FL_KEYDOWN 0x0065 'e' C . . . . . '€' U+20ac e2 82 ac <<< correct Keyboard (SV) 'number' keys (top row, not num. keypad) ... with AltGr: [ 6] FL_KEYDOWN 0x0031 '1' C A . . . . '' <<< ? (see below and [1]) [ 7] FL_KEYDOWN 0x0032 '2' C . . . . . '@' U+0040 40 [ 8] FL_KEYDOWN 0x0033 '3' C . . . . . '£' U+00a3 c2 a3 [ 9] FL_KEYDOWN 0x0034 '4' C . . . . . '$' U+0024 24 [ 10] FL_KEYDOWN 0x0035 '5' C . . . . . '€' U+20ac e2 82 ac [ 11] FL_KEYDOWN 0x0036 '6' C A . . . . '' <<< ? (see below and [1]) [ 12] FL_KEYDOWN 0x0037 '7' C . . . . . '{' U+007b 7b [ 13] FL_KEYDOWN 0x0038 '8' C . . . . . '[' U+005b 5b [ 14] FL_KEYDOWN 0x0039 '9' C . . . . . ']' U+005d 5d [ 15] FL_KEYDOWN 0x0030 '0' C . . . . . '}' U+007d 7d [ 16] FL_KEYDOWN 0x003d '=' C . . . . . '\' U+005c 5c <<< event_key should be '+' (see below) *** Windows Keyboard SV, WIP [nnn] Event Key Name, Flags: C A S M N L Text Unicode UTF-8/hex [ 1] FL_KEYDOWN 0x0079 'y' . . . . . . 'y' U+0079 79 [ 2] FL_KEYDOWN 0xffe3 FL_Control_L C . . . . . '' [ 3] FL_KEYDOWN 0xffea FL_Alt_R C A . . . . '' [ 4] FL_KEYDOWN 0x0071 'q' C A . . . . 'q' U+0071 71 [ 5] FL_KEYDOWN 0x0065 'e' C . . . . . '€' U+20ac e2 82 ac Keyboard (SV) 'number' keys (top row, not num. keypad) ... with AltGr: [ 7] FL_KEYDOWN 0xffe3 FL_Control_L C . . . . . '' [ 8] FL_KEYDOWN 0xffea FL_Alt_R C A . . . . '' [ 9] FL_KEYDOWN 0x0031 '1' C A . . . . '1' U+0031 31 <<< ? (see above and [1]) [ 10] FL_KEYDOWN 0x0032 '2' C . . . . . '@' U+0040 40 [ 11] FL_KEYDOWN 0x0033 '3' C . . . . . '£' U+00a3 c2 a3 [ 12] FL_KEYDOWN 0x0034 '4' C . . . . . '$' U+0024 24 [ 13] FL_KEYDOWN 0x0035 '5' C . . . . . '€' U+20ac e2 82 ac [ 14] FL_KEYDOWN 0x0036 '6' C A . . . . '6' U+0036 36 <<< ? (see above and [1]) [ 15] FL_KEYDOWN 0x0037 '7' C . . . . . '{' U+007b 7b [ 16] FL_KEYDOWN 0x0038 '8' C . . . . . '[' U+005b 5b [ 17] FL_KEYDOWN 0x0039 '9' C . . . . . ']' U+005d 5d [ 18] FL_KEYDOWN 0x0030 '0' C . . . . . '}' U+007d 7d [ 19] FL_KEYDOWN 0x002b '+' C . . . . . '\' U+005c 5c <<< event_key is correct ('+')
When I try keyboard.exe and press AltGR + '8' I get these values:Fl::event_key() => '8'
Fl::event_text() => '['
And Ctrl + right alt is pressed.So event text is ok but never reaches the input widgets.
Everything works now with the latest commit.
Thumbs up.