mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-15 12:29:32 +02:00
* show all details about the key event, without using KeyEventToString (because it
sometimes outputs control (<#32) ASCII characters) git-svn-id: branches/unicodekvm@40095 -
This commit is contained in:
parent
c10c9607f1
commit
e7ea79d71d
@ -15,21 +15,26 @@ begin
|
||||
Writeln;
|
||||
end;
|
||||
|
||||
procedure ShowUnicodeKey(WC: WideChar);
|
||||
begin
|
||||
Writeln('Unicode key #', Ord(WC));
|
||||
end;
|
||||
|
||||
procedure ShowKeyEvent(K: TKeyEvent);
|
||||
begin
|
||||
case GetKeyEventFlags(K) and 3 of
|
||||
kbASCII:
|
||||
ShowASCIIKey(GetKeyEventChar(K));
|
||||
kbUniCode:
|
||||
Writeln('Unicode key');
|
||||
ShowUnicodeKey(WideChar(GetKeyEventUniCode(K)));
|
||||
kbFnKey:
|
||||
Writeln('Function key');
|
||||
Writeln('Function key ', FunctionKeyName(GetKeyEventCode(K)));
|
||||
kbPhys:
|
||||
Writeln('Physical key ', K and $FFFF, ' - $' + HexStr(K and $FFFF, 4));
|
||||
end;
|
||||
Writeln('Shift state: ', ShiftStateToString(K, True));
|
||||
if (GetKeyEventFlags(K) and kbReleased) <> 0 then
|
||||
Writeln('Released key event');
|
||||
Writeln('Got key : ', KeyEventToString(K));
|
||||
end;
|
||||
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user