Click here to Skip to main content
15,880,725 members
Articles / Programming Languages / C++
Article

A handy keyobard shortcut for "Double Click" on VC6 IDE

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
3 Jun 2000 76K   6   8
Mark a word in VC6 without leaving the keyboard to double click with the mouse.

Introduction

This is very handy keyboard shortcut which started with the need to mark and select a word inside the IDE of VC6 without having to take my hand from the keyboard and use the mouse. In order to do that with the standard IDE commands of VC6 IDE one needs to use a couple of keyboard shortcuts. For example, when the cursor is in the middle of a word one has to press Ctrl + left arrow to go to the beginning of the word and then press Shift+Ctrl and right arrow to select the word, or double click the word with the mouse.

The following is a macro that does the above. I personally assigned it on the Ctrl+= shortcut because it was available.

Here is the code:

Sub doubleclick()
'DESCRIPTION: For simulated double clicking

'Begin Recording
	ActiveDocument.Selection.WordLeft
	ActiveDocument.Selection.WordRight dsExtend
'End Recording
End Sub

All you have to do is copy the above routine inside your macro file and assign a keyboard shortcut for it.

For those who don't know how to do that follow these instructions:

  • Open VC6. Go to the "Tools" menu, select "Macro".
  • Copy the above code.
  • On the dialog box that appears on the screen press "Edit".
  • Enter the name of the macro (in this case doubleclick) and the description "For simulated double clicking".
  • A file will open and the cursor will be right under the DESCRIPTION part of the function. Select the whole function and paste over it the above code.
  • When you finish save the file and close it.

To assign a keyboard shortcut select again the "Macro" option from the "Tools" menu. Select the "doubleclick" macro, press the "Options>>" button and then the "Keystrokes" button. On the dialog box that appears select the "doubleclick" macro and put the cursor on the "Press new shortcut key" field. Press the desired shortcut key (Ctrl + = worked for me).

If the shortcut you pressed is already assigned then under the field you get a message. In that case delete whatever you pressed and try a new shortcut. You won't believe how many keyboard shortcuts are already assigned for the IDE.

If the shortcut is not assigned then press close and you are ready.

Enjoy programming!!!

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Team Leader www.unitronics.com
Israel Israel
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Generalshort cut Pin
S Ganapathi Raman8-Apr-02 20:58
S Ganapathi Raman8-Apr-02 20:58 
GeneralBetter Do such thing Pin
Oleksandr Kucherenko14-Dec-01 3:22
Oleksandr Kucherenko14-Dec-01 3:22 
GeneralSome problems Pin
Igor Proskuriakov15-Jun-00 0:40
Igor Proskuriakov15-Jun-00 0:40 
GeneralRe: Some problems Pin
Phlip21-Nov-02 11:42
Phlip21-Nov-02 11:42 
Questionctrl-shift-left arrow? Pin
no6665-Jun-00 11:11
no6665-Jun-00 11:11 
right
AnswerRe: ctrl-shift-left arrow? Pin
Alberto Gattegno6-Jun-00 23:31
Alberto Gattegno6-Jun-00 23:31 
GeneralSometimes fails Pin
Zzynx5-Jun-00 4:34
sussZzynx5-Jun-00 4:34 
GeneralRe: Sometimes fails Pin
Alberto Gattegno5-Jun-00 6:18
Alberto Gattegno5-Jun-00 6:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.