AutoHotkey Community

It is currently May 26th, 2012, 1:43 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: December 10th, 2008, 1:37 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2008, 1:54 am 
Offline

Joined: June 27th, 2006, 2:38 pm
Posts: 385
Location: Canada
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2008, 3:46 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3329
Location: Simi Valley, CA
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2008, 11:37 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2008, 5:55 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2008, 6:17 am 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3329
Location: Simi Valley, CA
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 December 19th, 2008, 2:31 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2008, 7:02 am 
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}


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2008, 2:35 pm 
Offline
User avatar

Joined: October 7th, 2006, 8:45 am
Posts: 3329
Location: Simi Valley, CA
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 25th, 2008, 6:26 am 
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}


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 25th, 2008, 11:34 am 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
It is called the AppsKey, http://www.autohotkey.com/docs/KeyList.htm

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Newl, patgenn123, Pietro, poserpro and 17 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group