Solved

Developer Studio key to mark a word

Posted on 2004-09-24
7
187 Views
Last Modified: 2012-05-05
From within Developer Studio, I want to create a keystroke that will mark a word. Currently ctrl/shift/left will mark a word but  ctrl/shift/right marks the word plus the spaces to the next word.

Any ideas?
0
Comment
Question by:ESQuicksall
  • 4
  • 3
7 Comments
 
LVL 19

Expert Comment

by:drichards
ID: 12146753
Once again, start off with the macro recorder.  You want to do ctrl-shift-right and then a shift-left to back up if there was a space after the word.  This gets you a start.  Then you need to go edit the macro.  You want to back up until the last selected character is not a space.  It's actually a bit more complicated than that if you really want to do it right because you have to back up until to the last non-whitespace character.  I'll think about this a bit and see what I can come up with.
0
 
LVL 19

Accepted Solution

by:
drichards earned 250 total points
ID: 12146900
How do you want it to behave?  This will select from current position (in word or at start of word) to the end of the word, not including whitespace.  As I use it , though, it doesn't seem particularly useful because the selection can't be extended since it backs up over spaces.  Try it and let me know exactly what behavior you want.  Maybe this is enough to get you on the right track.
------------------------------
Sub SelWordRight()
'DESCRIPTION: A description was not provided.


'Begin Recording
      ActiveDocument.Selection.WordRight dsExtend
      While (Right(ActiveDocument.Selection,1) = " ") Or (Right(ActiveDocument.Selection,1) = vbTab)
            ActiveDocument.Selection.CharLeft dsExtend
      Wend
'End Recording
End Sub
0
 
LVL 19

Expert Comment

by:drichards
ID: 12146933
Two other options:

1) Use the original CTRL-SHIFT-RIGHT and add a macro to back out the whitespace if you want.  This could be assigned to ALT-SHIFT-LEFT or something.
2) Use the macro above and assign it to ALT-SHIFT-RIGHT and choose whether you want CTRL or ALT version of the command.

The trouble is that the software doesn't know whether you want to extend over the whitespace or not.  Somehow youneed to tell it.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:ESQuicksall
ID: 12168615
SelWordRight works perfectly. All I really want is to have a keystroke that does a "double click" on a word (I hate using a mouse). It does extend the selection if I use shift/right.

Also, with your example, I am able to see how to do more things.

Eddy
0
 

Author Comment

by:ESQuicksall
ID: 12168617
Adding more points for a hard problem.
0
 

Author Comment

by:ESQuicksall
ID: 12168854
I'm wondering why the word "Right" is used in the While. It does not seem intuitive because the highlight would be on a blank and not to the "Right".


Eddy
0
 

Author Comment

by:ESQuicksall
ID: 12168941
I'm going to add another one for you (or anyone else if they are knowledgable). It will be called "Making backspace act like rubout if not insert mode".
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

776 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