?
Solved

Storing informations in keybord keys ctrl

Posted on 2004-04-23
7
Medium Priority
?
201 Views
Last Modified: 2010-04-05
Hi,
How storage a text in a specificate key(for exemple: ctrl + Y), and when i press it, paste the text, in a form, for exemple. tnx
0
Comment
Question by:cels9
[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
  • 4
  • 3
7 Comments
 

Author Comment

by:cels9
ID: 10909188
these topics doenst matchs with my q. but, tnx
0
 
LVL 11

Accepted Solution

by:
shaneholmes earned 2000 total points
ID: 10909259
What part doesn't answer your question?

You register the key sequence (Ctrl + Y)


when its pressed, you can assign it to do what you want - in your case put some text somewhere



  private
    { Private declarations }
    Procedure WMHotkey( Var msg: TWMHotkey ); message WM_HOTKEY;





procedure TForm1.WMHotkey( Var msg: TWMHotkey );
  Begin
    If msg.hotkey = 1 Then
   Begin
    //paste the text you want to paste where you want to paste it!
    // example
   //edit1.text:= SomeText;
   End;
  End;

procedure TForm1.FormCreate(Sender: TObject);
begin
if RegisterHotKey(Handle,1, MOD_CONTROL ,ord('Yy)) = false then
      MessageDlg('Failed to register Hot Key',mtError,[mbOk],0);
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  UnRegisterHotkey( Form1.Handle, 1 );
end;

0
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!

 

Author Comment

by:cels9
ID: 10909471
ohh.. sorry. im newb :P tnx! and if i wanna ctrl + F ? :))
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10909481
if RegisterHotKey(Handle,2, MOD_CONTROL ,ord('f')) = false then
      MessageDlg('Failed to register Hot Key',mtError,[mbOk],0);


procedure TForm1.WMHotkey( Var msg: TWMHotkey );
  Begin
    If msg.hotkey = 1 Then
   Begin
    //paste the text you want to paste where you want to paste it!
    // example
   //edit1.text:= SomeText;
   End
  else
    If msg.hotkey = 2 Then
   Begin
    //paste the text you want to paste where you want to paste it!
    // example
   //edit1.text:= SomeText;
   End
  End;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  UnRegisterHotkey( Form1.Handle, 2 );
end;
0
 

Author Comment

by:cels9
ID: 10909529
tnx again
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10909539
NP

<SMILE>

Happy Coding!

Shane
0

Featured Post

Technology Partners: 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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
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

762 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