* minor VK assignment fixes

- Reduced some warnings

git-svn-id: trunk@10358 -
This commit is contained in:
marc 2006-12-29 01:09:59 +00:00
parent d4ef9bafdd
commit 977c77be92

View File

@ -2597,8 +2597,7 @@ procedure InitKeyboardTables;
end; end;
GDK_KEY_Tab, GDK_KEY_Tab,
GDK_KEY_ISO_Left_Tab, GDK_KEY_ISO_Left_Tab: AVKey := VK_TAB;
GDK_KEY_KP_Tab: AVKey := VK_TAB;
GDK_KEY_RETURN: AVKey := VK_RETURN; GDK_KEY_RETURN: AVKey := VK_RETURN;
// GDK_KEY_LINEFEED; AVKey := $0A; // GDK_KEY_LINEFEED; AVKey := $0A;
@ -2721,10 +2720,16 @@ procedure InitKeyboardTables;
end; end;
GDK_KEY_KP_F1..GDK_KEY_KP_F4: GDK_KEY_KP_F1..GDK_KEY_KP_F4:
begin begin
// I guess it is extended to differentiate between normal Fn // not on "normal" keyboard so defined extended to differentiate between normal Fn
AExtended := True; AExtended := True;
AVKey := VK_F1 + AKeySym - GDK_KEY_KP_F1; AVKey := VK_F1 + AKeySym - GDK_KEY_KP_F1;
end; end;
GDK_KEY_KP_TAB:
begin
// not on "normal" keyboard so defined extended to differentiate between normal TAB
AExtended := True;
AVKey := VK_TAB;
end;
GDK_KEY_KP_Multiply: GDK_KEY_KP_Multiply:
begin begin
// Keypad key is not extended // Keypad key is not extended
@ -3169,9 +3174,10 @@ begin
// else use the new VK. If the assigned VK was computed, bad luck. // else use the new VK. If the assigned VK was computed, bad luck.
// Some day we might this do smarter, but since those extra keys // Some day we might this do smarter, but since those extra keys
// are at the end, we probably wont hit the situation. // are at the end, we probably wont hit the situation.
if ComputeVK if ComputeVK and not DoMultiVK
then begin then begin
FreeVK := VKey; FreeVK := VKey;
ComputeVK := False;
VKey := VKeyRec.VKey; VKey := VKeyRec.VKey;
Flags := VKeyRec.Flags; Flags := VKeyRec.Flags;
end; end;
@ -3193,6 +3199,14 @@ begin
if (KeySymCharLen > SizeOf(TVKeyUTF8Char)) if (KeySymCharLen > SizeOf(TVKeyUTF8Char))
then DebugLn('[WARNING] InitKeyboardTables - Keysymstring for keycode=%u longer than %u bytes: %s', [n, SizeOf(TVKeyUTF8Char), KeySymChars]); then DebugLn('[WARNING] InitKeyboardTables - Keysymstring for keycode=%u longer than %u bytes: %s', [n, SizeOf(TVKeyUTF8Char), KeySymChars]);
// Add vkey to char lookups, keypad and functional keys are ignored
case VKey of
VK_TAB, VK_RETURN, VK_SPACE,
VK_0..VK_Z,
$5E,
$B8..$E4,
$E8..$F5: begin
VKeyRecPtr := MSymCharToVKMap.GetDataPtr(KeySymChars); VKeyRecPtr := MSymCharToVKMap.GetDataPtr(KeySymChars);
if VKeyRecPtr = nil if VKeyRecPtr = nil
then begin then begin
@ -3200,8 +3214,9 @@ begin
end end
else begin else begin
if (VKeyRecPtr^.VKey <> VKey) if (VKeyRecPtr^.VKey <> VKey)
or (VKeyRecPtr^.Flags <> Flags) then DebugLn('InitKeyboardTables - Duplicate Keysymstring="%s" for keycode=%u ignored. Existing: vkey=%u, flags=0x%2.2x New: vkey=%u, flags=0x%2.2x', [KeySymChars, n, VKeyRecPtr^.VKey, VKeyRecPtr^.Flags, VKey, Flags])
then DebugLn('InitKeyboardTables - Duplicate Keysymstring="%s" for keycode=%u. Existing: vkey=%u, flags=%u New: vkey=%u, flags=%u', [KeySymChars, n, VKeyRecPtr^.VKey, VKeyRecPtr^.Flags, VKey, Flags]); end;
end;
end; end;
if VKey <> $FF if VKey <> $FF