| View previous topic :: View next topic |
| Author |
Message |
frosty Guest
|
Posted: Wed Dec 10, 2008 12:37 am Post subject: backward search, delete a word, to the left |
|
|
| Hi. Just wondering if I can do like in Microsoft Word search backwards. I'm trying to send keystroke to do backward search of a space. Actually what I want my script to do is delete a word, to the left side. I'm trying to search the space to the left after this word. |
|
| Back to top |
|
 |
Conquer
Joined: 27 Jun 2006 Posts: 385 Location: Canada
|
Posted: Wed Dec 10, 2008 12:54 am Post subject: |
|
|
| Code: | | Send {Control Down}{Backspace}{Control Up} |
That will erase text until the next space. (Unless you're starting with a space, in which case it will erase until the first space after it reaches a character)
Hope that made sense and helped. |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 3254 Location: Simi Valley, CA
|
Posted: Wed Dec 10, 2008 2:46 am Post subject: |
|
|
| Code: | ; [Shift]+[backspace] to delete word (chars up to the first space to the left)
+BS::Send, {blind}^{Left}{Del} ; [ctrl]+[shift]+[left/right] = select chars up to space ('right' includes the space, 'left' doesn't) |
tested in notepad.
for me, ctrl+backspace prints a little rectangle () at the caret (in notepad), though it does work in firefox. _________________ Ternary (a ? b : c) guide TSV Table Manipulation Library
Post code inside [code][/code] tags! |
|
| Back to top |
|
 |
frosty Guest
|
Posted: Sat Dec 13, 2008 10:37 am Post subject: |
|
|
| Thank you guys for the quick reply. Yea, ctrl backspace also gave me box thingy. VXE your code worked perfectly. I tried to change {Left} with {Right} in hopes to delete word to the right, but didn't work. Just wondering if you have any ideas. |
|
| Back to top |
|
 |
frosty Guest
|
Posted: Wed Dec 17, 2008 4:55 am Post subject: |
|
|
| VXE, help me how to delete word to the right using same principle. I put {right} in place of {left} but didn't. Thanks in advance. I appreciate it. |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 3254 Location: Simi Valley, CA
|
Posted: Wed Dec 17, 2008 5:17 am Post subject: |
|
|
I'm not sure exactly what you're asking for.
| Code: | ; [Shift]+[backspace] to delete word (chars up to the first space to the left)
$+BS::Send, {blind}^{Left}{BS} ; [ctrl]+[shift]+[left/right] = select chars up to space ('right' includes the space, 'left' doesn't)
; [Shift]+[del] to delete word (chars up to and including the first space to the right)
$+Del::Send, {blind}^{Right}{BS} |
This *should* work. If you're having trouble, please give more information about what isn't working and about what you've tried to get it to work.
btw: recent experimentation has lead me to discover that [shift][del] is the same as 'cut' (or [ctrl][v]). I didn't know that before
[edit:] typo _________________ Ternary (a ? b : c) guide TSV Table Manipulation Library
Post code inside [code][/code] tags!
Last edited by [VxE] on Fri Dec 19, 2008 1:31 pm; edited 1 time in total |
|
| Back to top |
|
 |
frosty Guest
|
Posted: Fri Dec 19, 2008 6:02 am Post subject: |
|
|
Works perfect now. Thanks VXE. I just missed the second "}". Anywho, I was trying to have ctrl BS as hotkey, but didn't get it to work. Where did I go wrong?
$^BS::Send, {blind}^{Left}{BS} |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 3254 Location: Simi Valley, CA
|
Posted: Fri Dec 19, 2008 1:35 pm Post subject: |
|
|
| frosty wrote: | Where did I go wrong?
$^BS::Send, {blind}^{Left}{BS} |
Well, my previous code relied on the [shift] key being already down, hence the {blind} flag.
The exact sending without the {blind} should be | Code: | $+BS::Send, ^+{Left}{BS}
$^BS::Send, ^+{Right}{BS} |
*untested* _________________ Ternary (a ? b : c) guide TSV Table Manipulation Library
Post code inside [code][/code] tags! |
|
| Back to top |
|
 |
frosty Guest
|
Posted: Thu Dec 25, 2008 5:26 am Post subject: |
|
|
On second thought I can't have use CTRL cause I'm gonna need it to browse in between tabs in FF. I thought to use this one I don't know the name of the key is, which is the one in between RWin and RCtrl. Logo looks like a box with cursor. Also near Ctrl, it's convenient enough. VXE if you can please code me to have it
(???logo here???)+PgUp::Send, ^+{Left}{BS}
(???logo here???)+PgDn::Send, ^+{Right}{BS} |
|
| Back to top |
|
 |
SoLong&Thx4AllTheFish
Joined: 27 May 2007 Posts: 4999
|
|
| Back to top |
|
 |
|