![Avatar of edhasted](https://filedb.experts-exchange.com/files/public/2015/11/17/2f544bce-63c9-459e-befa-7ca14fe8a07b.gif)
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
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
![Avatar of BlackTigerX](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
![Avatar of edhasted](https://filedb.experts-exchange.com/files/public/2015/11/17/2f544bce-63c9-459e-befa-7ca14fe8a07b.gif)
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
![Avatar of edhasted](https://filedb.experts-exchange.com/files/public/2015/11/17/2f544bce-63c9-459e-befa-7ca14fe8a07b.gif)
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
![Avatar of Member_2_760301](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
hy edhasted, i'll post a link for download. My project captures all keystrokes even he is not focused.
![Avatar of Member_2_760301](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
![Avatar of edhasted](https://filedb.experts-exchange.com/files/public/2015/11/17/2f544bce-63c9-459e-befa-7ca14fe8a07b.gif)
ASKER
Hum - that link doesn't task me to the link I think you intended :-)
![Avatar of Member_2_760301](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
sry, my bad. try this: http://www.uploading.com/?get=ZIVU6I1W.
![Avatar of edhasted](https://filedb.experts-exchange.com/files/public/2015/11/17/2f544bce-63c9-459e-befa-7ca14fe8a07b.gif)
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
![Avatar of Member_2_760301](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
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