[Lazarus] VK codes error message

brian brian at meadows.pair.com
Tue Mar 15 12:56:37 CET 2011


On 03/14/2011 12:58 PM, Marc Weustink wrote:
> brian wrote:
>> I have a fairly simple Lazarus program, just a few edit boxes on a form
>> to enter some filenames and then it's doing a bunch of simple
>> manipulations on a text file.
>>
>> Using Linux Mint 9 (a fork from Ubuntu), Free Pascal 2.4.0 and Lazarus
>> 0.9.28.2, all 64-bit versions, when I run the program from konsole (run
>> from within GNOME) I get the following messages, before the program
>> (appears to?) run correctly
>>
>>
>> [WARNING] Out of OEM specific VK codes, changing to unassigned
>> [WARNING] Out of unassigned VK codes, assigning $FF
>>
>>
>> Can anyone tell me what's going on? The only things I can find about VK
>> codes pertain to Windows.
>
> Since the LCL is compatible with the Delphi VCL, lazarus needed to
> mimic the virtual keycodes used in OnKeyDown/Press/Up on other
> platforms than windows. To generate code compilable for different
> platforms, those virtual codes need to be the same for every platform.
>
> For the X based GTK1/2 some logic is added to map the keyboard layout
> reported by the X server to the Virtual keycodes.
> Modern distros nowadays tend to provide one keyboard map fitting most
> of the available keyboards. This leads a map with over the 150
> possible, sometimes exotic keys.
>  From a software pov. the LCL cannot tell what kind of keyboard the
> user has plugged in, so it maps all keys reported by the X server.
>
> Since the number of free to choose virtual keycodes is limited, the
> gtk1/2 logic runs out of codes for some of the exotic keys.
>
> So if you happen to have a keyboard with say functionkeys F24-F48 and
> those keys are mapped last by the X server, you may have problems in
> Lazarus when detecting KeyUp/Press/Down.
>

Thanks for the explanation, Marc. I'm relatively new to Lazarus, 
having programmed with Delphi/Windows since the Early Experience 
version, but I'd not seen this message before. I just have the 
standard 105 key USA keyboard here, so I wonder what has changed with 
the keys reported by the X server? I've written something like 20-30 
small utility programs for my own use since I switched to Linux on 
retirement, and as above, it's the first time I've seen the message.

I guess I just wait for the new releases to work their way through the 
packaging process and not worry about it further. :)

Thanks again,

Brian.






More information about the Lazarus mailing list