Solved

Storing informations in keybord keys ctrl

Posted on 2004-04-23
7
191 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
  • 4
  • 3
7 Comments
 
LVL 11

Expert Comment

by:shaneholmes
Comment Utility
0
 

Author Comment

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

Accepted Solution

by:
shaneholmes earned 500 total points
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

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

Expert Comment

by:shaneholmes
Comment Utility
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
Comment Utility
tnx again
0
 
LVL 11

Expert Comment

by:shaneholmes
Comment Utility
NP

<SMILE>

Happy Coding!

Shane
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now