Topic: KEY CODES

Hello MVD

Can I ask a sample on enabling button using key codes via script?

Thanks!

Re: KEY CODES

Hello.


Unfortunately can't understand the question, please provide more details.

Dmitry.

Re: KEY CODES

DriveSoft wrote:

Hello.


Unfortunately can't understand the question, please provide more details.

----------------------------------


I have a button in the form in which i set it in the properties enable=false.  Once i run the project the button must be disabled and that is correct. Now I want it enable using the a key codes or any combination of codes.

Pls  give a sample!

Thanks!

Re: KEY CODES

I estimate that is is looking for something to catch the keyboard buffer directly like the
cin
command from C++.


Getting directly the information what keys have been pressed on the keyboard to initiate an action regardsless which field has the focus and is active.

Re: KEY CODES

teco049 wrote:

I estimate that is is looking for something to catch the keyboard buffer directly like the
cin
command from C++.


Getting directly the information what keys have been pressed on the keyboard to initiate an action regardsless which field has the focus and is active.

---------------------
let say ctrl+home

Re: KEY CODES

Example for Ctrl+1

procedure Form1_OnKeyUp (Sender: string; var Key: Word; Shift, Alt, Ctrl: boolean);
begin
    if (Ctrl) and (Key=ord('1')) then Form1.Button1.Enabled := True;
end;

begin
     Form1.KeyPreview := True;
end.
Dmitry.

Re: KEY CODES

DriveSoft wrote:

Example for Ctrl+1

procedure Form1_OnKeyUp (Sender: string; var Key: Word; Shift, Alt, Ctrl: boolean);
begin
    if (Ctrl) and (Key=ord('1')) then Form1.Button1.Enabled := True;
end;

begin
     Form1.KeyPreview := True;
end.

=========

I got it!

Thanks Sir !