53 lines
913 B
ObjectPascal
53 lines
913 B
ObjectPascal
unit frmKeyb;
|
|
|
|
interface
|
|
|
|
uses
|
|
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
|
|
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Touch.Keyboard, Vcl.StdCtrls;
|
|
|
|
type
|
|
TformKeyb = class(TForm)
|
|
keyb1: TTouchKeyboard;
|
|
edtPopis: TEdit;
|
|
procedure FormShow (Sender: TObject);
|
|
procedure edtPopisKeyDown(Sender: TObject; var Key: Word;
|
|
Shift: TShiftState);
|
|
private
|
|
public
|
|
text: string;
|
|
end;
|
|
|
|
var
|
|
formKeyb: TformKeyb;
|
|
|
|
implementation
|
|
|
|
{$R *.dfm}
|
|
|
|
procedure TformKeyb.edtPopisKeyDown (Sender: TObject; var Key: Word; Shift: TShiftState);
|
|
begin
|
|
if (Key=VK_RETURN) then
|
|
begin
|
|
text:= Trim(edtPopis.Text);
|
|
Close;
|
|
end;
|
|
|
|
if (Key=VK_ESCAPE) then
|
|
begin
|
|
text:= '';
|
|
Close;
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TformKeyb.FormShow (Sender: TObject);
|
|
begin
|
|
edtPopis.Text:= '';
|
|
edtPopis.SetFocus;
|
|
end;
|
|
|
|
end.
|