Now I think about it, it might be interesting to test in Windows and MacOS and see the differences (if any).
It would be, but at the moment I only operate in a Linux universe so I don't have any machines to investigate that.
For the technically curious, this is the code producing that output
Thanks for providing that. Before posting I also had a little test program to print out the values of
key (as a
Word rather than a
Char) for the
OnKeyDown event and compared those with the output of
xev. There isn't much (any?) relationship between those values, assumedly because FreePascal/Lazarus maps values to those (very) old Windows
VK_ values.
For example:
xev gives:
Alt as 64,
AltGr as 108, left
Windows key as 133, right
Windows key as 134
Lazarus gives:
Alt as 18
(ssAlt), AltGr as 228
(ssAlt), left
Windows key as 91
(ssMeta), right
Windows key as 92 (no shift state)
I'd quite like to see where the values delivered to Lazarus are mapped to
VK_ key values and ultimately shift states, but at the moment I don't have the energy or enthusiasm sufficient to plough through the source code. It isn't even clear where Lazarus is getting the values from. My Lazarus form is covered by an OpenGL control, and a Lazarus form is in any case a window provided by the desktop environment (in my case KDE/Plasma) with a little help from a toolkit (I use the default Lazarus built on Gtk); KDE sits on X11 and everything is on top of Linux, so ... somebody must know where raw key codes are mapped to shift states, but that somebody isn't me.