Keyboard input/Keypress check: Difference between revisions

Line 24:
if(Console.KeyAvailable)
chr = Console.ReadKey().Key.ToString();</lang>
 
=={{header|Delphi}}==
This is valid for a GUI application!
<lang Delphi>
unit Unit1;
 
interface
 
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;
 
type
TForm1 = class(TForm)
procedure FormKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
SavedPressedKey: Char;
public
{ Public declarations }
end;
 
var
Form1: TForm1;
 
implementation
 
{$R *.dfm}
 
procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
SavedPressedKey := Key;
end;
 
end.
</lang>
 
=={{header|Euphoria}}==
16

edits