AutoHotkey Community

It is currently May 27th, 2012, 10:10 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
 Post subject:
PostPosted: April 30th, 2010, 5:48 pm 
Offline
User avatar

Joined: December 30th, 2009, 10:30 pm
Posts: 160
Location: Worcester, Massachusetts
Hey Orygynl,
I'm pretty sure that mod has been proposed, and I think it was found to be not possible. Someone correct me if I'm wrong
Sincerely,
berban

_________________
★★★ Email me at berban at aim full stop com ★★★


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 30th, 2010, 6:27 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Removing the "I" from the options of the Input command might help, with a couple more changes (untested):
AHK Help wrote:
I: Ignore input generated by any AutoHotkey script, such as the SendEvent command. However, the SendInput and SendPlay methods are always ignored, regardless of this setting.
To avoid possible infinite loops, use SendInput inside the loop of the script, and make SendEvent the sending method for your hotstrings (SE option).


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 30th, 2010, 6:33 pm 
Offline
User avatar

Joined: December 30th, 2009, 10:30 pm
Posts: 160
Location: Worcester, Massachusetts
Seems like that should work, but I just tested it with no results :(

_________________
★★★ Email me at berban at aim full stop com ★★★


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 30th, 2010, 9:13 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
I see the problem: the HotString processing in AHK records your keyboard entries, and ignores the script generated keys, so it does not see a change of the capitalization. One (not so nice) idea of solution is to maintain another variable "set" in the main loop, telling if a capitalization occurred. It is cleared at a whitespace char. You also have to change all of your HotStrings to use this "set" variable to determine, what to substitute. E.g.:
Code:
::btw::
      Send % (set ? "B" : "b") "y the way"
Return
You have to refine the idea, like resetting the "set" variable at certain other characters or mouse activities…
Code:
Loop {
   Input key, I L1 V,
(  Join
{ScrollLock}{CapsLock}{NumLock}{Esc}{BS}{PrintScreen}{Pause}{LControl}{RControl}
{LAlt}{RAlt}{LShift}{RShift}{LWin}{RWin}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}
{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Del}{Ins}
)
   If StrLen(ErrorLevel) > 3   ; NewInput, EndKey
      state =
   Else If InStr(".!?",key)    ; Sentence end
      state = 1
   Else If InStr("`t `n",key)  ; White space
      state += (state = 1), set := 0 ; state1 -> state2
   Else {
      StringUpper key, key
      If (state = 2) {         ; End-Space*-Letter
         SendInput {BS}{%key%} ; Letter -> Upper case
         set := 1
      }
      state =
   }
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 1st, 2011, 6:06 am 
Offline

Joined: August 4th, 2010, 11:40 am
Posts: 3
Hi all!

Firstly, thanks for the brilliant script! Pure genius!

I'm currently using Autocorrect.ahk, the version listed below.
http://www.autohotkey.com/download/OtherDownloads.htm
which is a bit more comprehensive then
http://www.autohotkey.com/docs/Hotstrin ... utoCorrect

1st WishList
When AutoCorrect is used together with this AutoCapitalise script, it works fine except....
it won't capitalise words autocorrected by AutoCorrect.

For eg.
Autohotkey substitution -> tot::thought
Code:
Hello. thought |

[Note: "|" represents the cursor position]

As you can see, "thought" isn't capitalised because it has been substituted by AutoCorrect.

2nd WishList
At this point, I also thought it'll be great to also implement the blackberry "double space to fullstop" feature. It will be especially useful in these situations where AutoCorrect is coupled with AutoCapitalise. Specifically, when the ending word before a fullstop is to be substituted.

For eg.
Autohotkey substitution -> tot::thought
Code:
Hello. thought |

[Note: "|" represents the cursor position]

After typing "tot", it is substituted to "thought" and the cursor's position is as indicated. The problem is when you want to end the sentence right there, you have to do a BackSpace first before putting a FullStop and then pressing Spacebar before beginning the next sentence!
The neat Blackberry feature cuts down all this to simply pressing another SpaceBar!

State Machine Style Programming
Btw, I'm just wondering... where did you learn abt state machines style of programming? Electronics Digital Design course i presume?

It seems like a pretty neat skill. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Sorry, but
PostPosted: February 23rd, 2011, 4:16 am 
Offline

Joined: December 26th, 2010, 7:40 pm
Posts: 4172
Location: Awesometown, USA
Sorry for my ignorance, but what is the advantage of this over
http://www.autohotkey.com/forum/viewtop ... talization
? I don't mean to offend, I'm just curious


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 23rd, 2011, 7:28 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
Nimda's script is too simple, much more restricted. Here are a few issues with it:
- It only replaces, when {!?.} is followed by one space -> next char capitalized: two spaces, new lines are not handled. ".{space}{space}{BS}a" does not do anything...
- after ". ", "? ", "! " Nimda prevents using many keys, like BS, F[n], Ctrl+Key, Win+key, etc. You may even think your PC crashed.
- It unnecessarily excludes certain chars after {!?.}: ".{ESC} a" does not capitalize.
- It erroneously capitalizes after the mouse changes the insertion point ". {click}a" replaces a with A somewhere you may not want.

Nevertheless, if you know its limitations, Nimda's script can be useful, too.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2011, 12:11 am 
Offline

Joined: April 14th, 2009, 10:40 am
Posts: 182
Hi!

Maybe this solution may help!
Use Hostring() from polyethene's "Dynamic Hotstrings" with this
Code:
hotstrings("(\.|!|\?)( |`n|`t)+(.)$", "$1$2$U3")
To work fine, you also should add this line (in red)
Code:
      Loop, Parse, t, `n ; check
      {
         StringSplit, x, A_LoopField, `r
         If (RegExMatch(s, x1 . "$", $)) ; match
         {
            StringLen, l, $
            StringTrimRight, s, s, l
            SendInput, {BS %l%}
            If (IsLabel(x2))
               Gosub, %x2%
            Else
            {
               x0 := RegExReplace($, x1, x2)
               Transform, x0, Deref, %x0%
               SendRaw, %x0%
            }
         }
      }
      If (StrLen(s) > w)
         StringTrimLeft, s, s, w // 2
   }


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC [ DST ]


Who is online

Users browsing this forum: specter333, sumon and 24 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