AutoHotkey Community

It is currently May 24th, 2012, 9:51 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: April 4th, 2007, 8:30 pm 
Offline

Joined: April 4th, 2007, 8:25 pm
Posts: 12
Hi everyone!

I have done quite some digging in different documentation about AutoHotKey, but I couldn't find a solution to the following problem. I hope somebody can help:

On my job we have to do lots of math typesetting using Latex (http://en.wikipedia.org/wiki/LaTeX). All commands begin with a backslash. At least on the German keyboard the backslash is very unconvenient to type. Thus I put the backslash on the Caps Lock key using Ahk.

But now I would like to use hotstrings with the backslash. E. g.:

::\a::\alpha

Well, this doesn't work, when I use the Caps Lock key to produce the backslash. I know that is by design. But I wonder if anyone can produce a workaround to this behavior.

Thanks for anything helpful,

Helge from Germany



:lol:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 4th, 2007, 9:26 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8646
Location: Salem, MA
is there some key other than CapsLock you can use for \?

Have you tried:
Code:
CapsLock & a::Send, \alpha

(requires holding capslock while you press a)

is / convinient?
Code:
::/a::\alpha

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 5th, 2007, 5:18 pm 
Offline

Joined: April 4th, 2007, 8:25 pm
Posts: 12
Thank you for your comments!

Quote:
is there some key other than CapsLock you can use for \?


The only viable alternative would be '#' on the German keyboard layout, but it is just the same problem with '#'.

Quote:
CapsLock & a::Send, \alpha


Won't work because there are many other shortscuts like
\ed = \end{document}, which require multiple character Hotstrings.

Quote:
is / convinient?


No, because there are hundreds of commands and it would be to much work to define shortcuts for all of them. All commands regardless if it is a Hotstring or not should start with the same character. It is confusing to if you have to start abbreviated commands with a different character than hand-typed commands. And LaTeX-Commands start with "\".

:) Helge


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 5th, 2007, 10:31 pm 
Offline

Joined: September 2nd, 2006, 6:39 am
Posts: 279
Location: Scotland
Code:
Capslock::
Send, \
Input, Var, L1 V T3
If Var = a
Send, {backspace 2}\alpha
If Var = b
Send, {backspace 2}\beta
 ; etc etc
Return


Obviously the backspaces arent needed for that example but they would be for any others where the first 2 characters arent at the start of the string to be sent

EDIT: Just read your second post about needing multiple letter hotstrings.That method would need more code if the hotstrings will be of varying length.

I suppopse you could up the input length and then check each letter of the string that was input or add every letter as an endkey and then have extra Input commands depending on what key was pressed

EDIT2: Just had a thought.You could use actual hotstrings for when you want to use multiple letters by checking if the last pressed hotkey was capslock

Code:
:B0*:ed::
If A_PriorHotkey = Capslock
send, {Backspace 3}\end
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 16th, 2008, 3:10 pm 
Thanks a lot! That works great! :D This is my version, with where the number of backspaces is not needed to be changed when the length of the Hotstring changes. It is triggered by "\test".

Code:
:*:test::
   If A_PriorHotkey = Capslock
   Send,{Backspace 1}
   Send,\end
   return


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: azure, Bing [Bot], Blackholyman, BrandonHotkey, Cephei1, patgenn123, Xx7, Yahoo [Bot] and 69 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