* fixed synedit navigation on OSX

git-svn-id: trunk@7194 -
This commit is contained in:
marc 2005-05-21 19:27:41 +00:00
parent cd46768efa
commit c75840a847

View File

@ -2804,6 +2804,22 @@ procedure InitKeyboardTables;
end; end;
end; end;
end; end;
function IgnoreShifted(const AUnshiftKeySym: TKeySym): Boolean;
begin
case AUnshiftKeySym of
GDK_KEY_END,
GDK_KEY_HOME,
GDK_KEY_LEFT,
GDK_KEY_RIGHT,
GDK_KEY_UP,
GDK_KEY_DOWN,
GDK_KEY_PAGE_UP,
GDK_KEY_PAGE_DOWN: Result := True;
else
Result := False;
end;
end;
procedure NextFreeVK(var AFreeVK: Byte); procedure NextFreeVK(var AFreeVK: Byte);
begin begin
@ -2887,7 +2903,15 @@ begin
for m := 0 to 3 do for m := 0 to 3 do
begin begin
ByteKey:=Byte(n); ByteKey:=Byte(n);
KeySym[m] := XKeyCodeToKeysym(Display, ByteKey, m);
// don't allow a keysym for shifted navigation keys
// somehow the default keymap on OSX combines U/ D= L+ R*
// As a simple hack I think we can ignore keysyms for shifted
// navigation keys
if ((m and 1) = 1) and IgnoreShifted(KeySym[m - 1])
then KeySym[m] := 0
else KeySym[m] := XKeyCodeToKeysym(Display, ByteKey, m);
if (VKey = $FF) and (KeySym[m] <> 0) if (VKey = $FF) and (KeySym[m] <> 0)
then begin then begin
HasKey := True; HasKey := True;
@ -2903,7 +2927,7 @@ begin
VKey := FreeVK; VKey := FreeVK;
NextFreeVK(FreeVK); NextFreeVK(FreeVK);
end; end;
// The keypadkeys have 2 VK_keycodes :( // The keypadkeys have 2 VK_keycodes :(
// In that case we have to FIndKeyInfo for every keysym // In that case we have to FIndKeyInfo for every keysym
DoMultiVK := HasMultiVK; DoMultiVK := HasMultiVK;
@ -2984,6 +3008,7 @@ begin
if VKey <> $FF if VKey <> $FF
then MVKeyInfo[VKey].KeyCode := Byte(n); then MVKeyInfo[VKey].KeyCode := Byte(n);
end; end;
WriteLN;
end; end;
{$ENDIF} {$ENDIF}
@ -8179,6 +8204,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.357 2005/05/21 19:27:41 marc
* fixed synedit navigation on OSX
Revision 1.356 2005/05/05 19:47:15 micha Revision 1.356 2005/05/05 19:47:15 micha
fix gtk2 compilation (from drewski) fix gtk2 compilation (from drewski)