Solved

How can I make my own Keyboard shortcut?

Posted on 2009-04-01
9
1,255 Views
Last Modified: 2012-05-06
hi there,
In Visual Studio you can select code and then press the 'TAB' key to indent it.
However in Delphi to do the same process you need to use 'CNTRL' + 'SHIFT' + 'U'.
I would like to change it so that I can use the 'TAB' Key.
How can I do this?
cheers
Myles
0
Comment
Question by:myleseven
  • 5
  • 3
9 Comments
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 24047072
change the editor options EditorSpeedsettings to Visual Studio Emulation
0
 

Author Comment

by:myleseven
ID: 24054073
Thanks for your suggestion Geert, but this didn't seem to work for me.
I am running Delphi 6.
Cheers

Myles
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 24054254
did you check the keyboard emulations ?
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:myleseven
ID: 24055843
When I changed the keyboard emulations to Visual Studio there was some changes. For example the keyboard shortcuts for debugging changed from f8 and f7 to f10 and f11 as they would be in visual studio. however if I highlighted text and pushed the 'TAB' key it deleted the text instead of 'tabbing' it across the page.
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 24056726
that's funny, my tabbing works fine
i'll post my settings later on
0
 
LVL 37

Expert Comment

by:Geert Gruwez
ID: 24057074
if you want to have your own customization you'll have to write a Delphi Expert/Wizard
This is a lot of work and the code is not very well documented, next to that it undergoes some changes

what i did find was www.gexperts.org

i wrote some changes on that once to add a Ctrl-Alt-+ and Ctrl-Alt-- to change the current notebook page the current component is on
If your interested in this code, that i can give.
you could then adapt it to use a other shortcut key, this way you could create your own shortcut keys ...
0
 
LVL 37

Accepted Solution

by:
Geert Gruwez earned 25 total points
ID: 24057114
it also looks like you'll have to create your own key mappings:

Key mapping modules

Enables you to quickly switch key bindings.

Mapping      Effect

Default      Uses key bindings that match CUA mappings (default).
IDE classic      Uses key bindings that match Borland Classic editor keystrokes.
BRIEF emulation      Uses key bindings that emulate most of the standard Brief keystrokes.
Epsilon emulation      Uses key bindings that emulate a large part of the Epsilon editor.
Visual Studio emulation      Uses key bindings that emulate a large part of the Visual Studio editor.

Visual Basic emulation      Uses key bindings that emulate a large part of the Visual Basic editor.

New IDE Emacs      Uses key bindings that emulate much of the Emacs editor.

Note: The New IDE Classic is provided as an example only.

Enhancement modules

Enhancement modules are special packages that are installed and registered and use the keyboard binding features that can be developed using the Open Tools API. You can create enhancement modules that contain new keystrokes or apply new operations to existing keystrokes. For details on the Open Tools API, see Extending the IDE.

Once installed, the enhancement modules become visible in the Enhancement modules list box. Clicking the check box next to the enhancement module enables it and unchecking it disables it. Key mapping defined in an installed and enabled enhancement module overrides any existing key mapping defined for that key in the key mapping module which is currently in effect.

Here are some links on this subject:
http://xpro.com.au/Presentations/OpenToolsAPI/Plug-in,%20Switch%20On,%20Fall%20Over%20-%20Adventures%20with%20the%20Open%20Tools%20API.htm
http://www.gexperts.org/opentools/
dutch: http://www.nldelphi.com/cgi-bin/articles.exe/ShowArticle?ID=7257
0
 
LVL 19

Assisted Solution

by:MerijnB
MerijnB earned 25 total points
ID: 24064409
http://andy.jgknet.de/blog/?page_id=10 can do exactly what you want.
0
 

Author Closing Comment

by:myleseven
ID: 31565631
Hi thanks Geert for all your ehlp. I don't really want to go to all that trouble just to build a keyboard shortcut but I appreciatte all the advice you gave me.
The dev tool that MerjinB pointed me to ended up solving my problem straight away.
I have given you both points for your help.
Thanks alot.
myles
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

825 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