mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 00:09:23 +02:00
* consider endianess for KeyCode/CharCode-ScanCode pairs
This commit is contained in:
parent
fb0e90be51
commit
f1601bd355
@ -54,6 +54,10 @@ UNIT Drivers;
|
|||||||
{$V-} { Turn off strict VAR strings }
|
{$V-} { Turn off strict VAR strings }
|
||||||
{====================================================================}
|
{====================================================================}
|
||||||
|
|
||||||
|
{$ifdef CPU68K}
|
||||||
|
{$DEFINE ENDIAN_BIG}
|
||||||
|
{$endif CPU68K}
|
||||||
|
|
||||||
USES
|
USES
|
||||||
{$IFDEF OS_WINDOWS} { WIN/NT CODE }
|
{$IFDEF OS_WINDOWS} { WIN/NT CODE }
|
||||||
Windows, { Standard unit }
|
Windows, { Standard unit }
|
||||||
@ -247,11 +251,18 @@ TYPE
|
|||||||
Buttons: Byte; { Mouse buttons }
|
Buttons: Byte; { Mouse buttons }
|
||||||
Double: Boolean; { Double click state }
|
Double: Boolean; { Double click state }
|
||||||
Where: TPoint); { Mouse position }
|
Where: TPoint); { Mouse position }
|
||||||
evKeyDown: ( { ** KEY EVENT ** }
|
evKeyDown: (
|
||||||
|
{ ** KEY EVENT ** }
|
||||||
Case Sw_Integer Of
|
Case Sw_Integer Of
|
||||||
0: (KeyCode: Word); { Full key code }
|
0: (KeyCode: Word); { Full key code }
|
||||||
1: (CharCode: Char; { Char code }
|
1: (
|
||||||
|
{$ifdef ENDIAN_BIG}
|
||||||
|
ScanCode: Byte;
|
||||||
|
CharCode: Char;
|
||||||
|
{$else not ENDIAN_BIG}
|
||||||
|
CharCode: Char; { Char code }
|
||||||
ScanCode: Byte; { Scan code }
|
ScanCode: Byte; { Scan code }
|
||||||
|
{$endif not ENDIAN_BIG}
|
||||||
KeyShift: byte)); { Shift states }
|
KeyShift: byte)); { Shift states }
|
||||||
evMessage: ( { ** MESSAGE EVENT ** }
|
evMessage: ( { ** MESSAGE EVENT ** }
|
||||||
Command: Sw_Word; { Message command }
|
Command: Sw_Word; { Message command }
|
||||||
@ -1112,6 +1123,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
Event.What:=evKeyDown;
|
Event.What:=evKeyDown;
|
||||||
Event.KeyCode:=keycode;
|
Event.KeyCode:=keycode;
|
||||||
|
{$ifdef ENDIAN_LITTLE}
|
||||||
|
Event.CharCode:=chr(keycode and $ff);
|
||||||
|
Event.ScanCode:=keycode shr 8;
|
||||||
|
{$endif ENDIAN_LITTLE}
|
||||||
Event.KeyShift:=keyshift;
|
Event.KeyShift:=keyshift;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -1677,7 +1692,10 @@ BEGIN
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.35 2002-09-22 19:42:22 hajny
|
Revision 1.36 2002-10-07 15:44:43 pierre
|
||||||
|
* consider endianess for KeyCode/CharCode-ScanCode pairs
|
||||||
|
|
||||||
|
Revision 1.35 2002/09/22 19:42:22 hajny
|
||||||
+ FPC/2 support added
|
+ FPC/2 support added
|
||||||
|
|
||||||
Revision 1.34 2002/09/13 22:24:30 pierre
|
Revision 1.34 2002/09/13 22:24:30 pierre
|
||||||
|
@ -54,6 +54,10 @@ UNIT Drivers;
|
|||||||
{$V-} { Turn off strict VAR strings }
|
{$V-} { Turn off strict VAR strings }
|
||||||
{====================================================================}
|
{====================================================================}
|
||||||
|
|
||||||
|
{$ifdef CPU68K}
|
||||||
|
{$DEFINE ENDIAN_BIG}
|
||||||
|
{$endif CPU68K}
|
||||||
|
|
||||||
USES
|
USES
|
||||||
{$IFDEF OS_WINDOWS} { WIN/NT CODE }
|
{$IFDEF OS_WINDOWS} { WIN/NT CODE }
|
||||||
Windows, { Standard unit }
|
Windows, { Standard unit }
|
||||||
@ -247,11 +251,18 @@ TYPE
|
|||||||
Buttons: Byte; { Mouse buttons }
|
Buttons: Byte; { Mouse buttons }
|
||||||
Double: Boolean; { Double click state }
|
Double: Boolean; { Double click state }
|
||||||
Where: TPoint); { Mouse position }
|
Where: TPoint); { Mouse position }
|
||||||
evKeyDown: ( { ** KEY EVENT ** }
|
evKeyDown: (
|
||||||
|
{ ** KEY EVENT ** }
|
||||||
Case Sw_Integer Of
|
Case Sw_Integer Of
|
||||||
0: (KeyCode: Word); { Full key code }
|
0: (KeyCode: Word); { Full key code }
|
||||||
1: (CharCode: Char; { Char code }
|
1: (
|
||||||
|
{$ifdef ENDIAN_BIG}
|
||||||
|
ScanCode: Byte;
|
||||||
|
CharCode: Char;
|
||||||
|
{$else not ENDIAN_BIG}
|
||||||
|
CharCode: Char; { Char code }
|
||||||
ScanCode: Byte; { Scan code }
|
ScanCode: Byte; { Scan code }
|
||||||
|
{$endif not ENDIAN_BIG}
|
||||||
KeyShift: byte)); { Shift states }
|
KeyShift: byte)); { Shift states }
|
||||||
evMessage: ( { ** MESSAGE EVENT ** }
|
evMessage: ( { ** MESSAGE EVENT ** }
|
||||||
Command: Sw_Word; { Message command }
|
Command: Sw_Word; { Message command }
|
||||||
@ -1112,6 +1123,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
Event.What:=evKeyDown;
|
Event.What:=evKeyDown;
|
||||||
Event.KeyCode:=keycode;
|
Event.KeyCode:=keycode;
|
||||||
|
{$ifdef ENDIAN_LITTLE}
|
||||||
|
Event.CharCode:=chr(keycode and $ff);
|
||||||
|
Event.ScanCode:=keycode shr 8;
|
||||||
|
{$endif ENDIAN_LITTLE}
|
||||||
Event.KeyShift:=keyshift;
|
Event.KeyShift:=keyshift;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -1677,7 +1692,10 @@ BEGIN
|
|||||||
END.
|
END.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.35 2002-09-22 19:42:22 hajny
|
Revision 1.36 2002-10-07 15:44:43 pierre
|
||||||
|
* consider endianess for KeyCode/CharCode-ScanCode pairs
|
||||||
|
|
||||||
|
Revision 1.35 2002/09/22 19:42:22 hajny
|
||||||
+ FPC/2 support added
|
+ FPC/2 support added
|
||||||
|
|
||||||
Revision 1.34 2002/09/13 22:24:30 pierre
|
Revision 1.34 2002/09/13 22:24:30 pierre
|
||||||
|
Loading…
Reference in New Issue
Block a user