edhasted
asked on
Delphi - how to capture all keystrokes
I'm need to write a program for some blind users. They read the screen with a voice box. However their tutors are often helping them remotely. Knowing what keys they have actually pressed can be very hit and miss. So I need to write a program that can display whatever keystrokes they have typed in. This can be simply displayed in a memo box so their remote tutors can see what is actually going on.
How do I capture the keystroke feed, and maybe mouse left or right click, if the Delphi app doesn't have the focus.
With many thanks,
Ed
How do I capture the keystroke feed, and maybe mouse left or right click, if the Delphi app doesn't have the focus.
With many thanks,
Ed
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Will work my way through these over the weekend - they look extremely impressive and just what I'm looking for.
Many thanks - Ed
Many thanks - Ed
ASKER
Have compiled NODRAMAS's code OK, however I've clearly missed something out.
I put the obvious memo box in the form but text only appears in it when I have focus on the Memo box, which is how they normally work.
Isn't it meant to record the keystokes into the memo box irrespective of what and where I am typing?
Any ideas?
Ed
I put the obvious memo box in the form but text only appears in it when I have focus on the Memo box, which is how they normally work.
Isn't it meant to record the keystokes into the memo box irrespective of what and where I am typing?
Any ideas?
Ed
hy edhasted, i'll post a link for download. My project captures all keystrokes even he is not focused.
ASKER
Hum - that link doesn't task me to the link I think you intended :-)
sry, my bad. try this: http://www.uploading.com/?get=ZIVU6I1W.
ASKER
Can I thank "nodramas" for not only a really clever, but complete, solution.
With very many thanks,
Ed Hasted
With very many thanks,
Ed Hasted
glad i could help.
best wishes.
best wishes.
private
procedure WMNCRBUTTONDOWN(var msg: TMessage); message WM_NCRBUTTONDOWN;
procedure WMNCLBUTTONDOWN(var msg: TMessage); message WM_NCLBUTTONDOWN;
procedure WMNCLBUTTONDBLCLK(var msg: TMessage); message WM_NCLBUTTONDBLCLK;
end;
implementation
procedure TForm1.WMNCRBUTTONDOWN(var
begin
if msg.wParam = HTCAPTION then Caption := 'Right Click!';
// Message.Result := 0; {to ignore the message}
inherited;
end;
procedure TForm1.WMNCLBUTTONDOWN(var
begin
if msg.wParam = HTCAPTION then Caption := 'Left Click!';
// Message.Result := 0; {to ignore the message}
inherited;
end;
procedure TForm1.WMNCLBUTTONDBLCLK(v
begin
if msg.wParam = HTCAPTION then Caption := 'Double Click!';
// Message.Result := 0; {to ignore the message}
inherited;
end;
probably might help. //from torry's page