change keypressed

hi experts
i want to know how i can traping key pressed and void or chang it. please help me by Source Code. Thanks
LVL 1
mahdiparakAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike LittlewoodEngineerCommented:
For voiding a key

procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  Key := 0
end;
Mike LittlewoodEngineerCommented:
Do you want the keydown function to be application wide, or per component.
If per component then you need to write one for each.
If application wide, make sure you set the value of the main form of your application "KeyPreview = True" in the object inspector.
Mike LittlewoodEngineerCommented:
For changing the key I would probably do it on KeyPress event of the components

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if key = 'a' then
    key := 'b'
end;
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

mahdiparakAuthor Commented:
thanks but i want Keyboard hook and work my application with other application such az MS Word
A. Cristian CsikiSenior Security AdministratorCommented:
geobulCommented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mahdiparakAuthor Commented:
thanks
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.