?
Solved

CURSOR

Posted on 1998-06-11
2
Medium Priority
?
261 Views
Last Modified: 2010-04-04
pLEASE COULD ANYONE HELP? I need a program in Delphi that will allow you to use the cursor keys to move a pointer around a window along with the home key and the return key. I would be extremely grateful.
Thanks very much if you try and help me
Tony.
0
Comment
Question by:TREKY11
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
inter earned 280 total points
ID: 1352161
Hi,
Link this with your form code and make Form1 keypreview TRUE.

procedure TWebform.Form1KeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
var
  P : TPoint;
begin
  GetCursorPos(P);
  case Key of
    vk_Left :  Dec(P.X,5);
    vk_Right:  Inc(P.X,5);
    vk_Up   :  Dec(P.Y,5);
    vk_Down :  Inc(P.Y,5);
    vk_Home : ; //do what you want
    vk_Return: ; //do what you want
  end;
  SetCursorPos(P.X,P.Y);
end;

Regards, Igor
0
 

Author Comment

by:TREKY11
ID: 1352162
cHEER MATE THANKS ALLOT THIS CODE IS JUST PERFECT THANKS.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question