 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
ManaUser
Joined: 24 May 2007 Posts: 906
|
Posted: Fri Feb 29, 2008 12:10 am Post subject: Yet another accent / special character script |
|
|
This is inspired by how MS Word does it. You press Ctrl and a key representing the accent symbol (`'^:~@,&/-$) then a litter. But I expanded it a little. The Ctrl+` modifier can be combined with several other keys to make various symbols, as can a few others. For instance Ctrl+/, previous only used for Ø also does ¼, ½ and ¾. Finally I added Ctrl+$ for currency symbols.
| Code: | #SingleInstance Force
#NoEnv
SendMode Input
;--------------------
CharList =
( LTrim ` %
`aàeèiìoòuùAÀEÈIÌOÒUÙ?¿?¡'‘"“c©r®t™2²3³0°*•x×/÷%‰.…+†|‡s§p¶mµ
'aáeéiíoóuúyýAÁEÉIÍOÓUÚYÝ'’"”
^aâeêiîoôuûsšzžAÂEÊIÎOÔUÛSŠZŽ
:aäeëiïoöuüyÿAÄEËIÏOÖUÜYŸ
~aãnñoõAÃNÑOÕ
@aåAÅ
,cçCÇ
/oøOØ4¼2½3¾
&aæoœsßAÆOŒ
-tþdðTÞDÐn–m—+±
$c¢l£p£y¥e€*¤fƒ
)
AccentChars := "``'^:~@,/&-$"
Loop Parse, AccentChars
HotKey ^%A_LoopField%, Accent
Accent:
Accent := SubStr(A_ThisHotkey, 0, 1)
SetTimer HandleAccent, -1
Return
HandleAccent:
Input BaseChar, L1VM
If (Asc(BaseChar) < 32)
Return
Found := RegExMatch(CharList, "`am)^\Q" . Accent . "\E\S*\Q" . BaseChar . "\E(.)", Match)]
If Found
Send {BS}%Match1%
Return |
Here's the full list:
| Code: | Ctrl+` (Grave Accent, Left Quotes and Misc)
aeiouAEIOU??'"crt230*x/%.+|spm
àèìòùÀÈÌÒÙ¿¡‘“©®™²³°•×÷‰…†‡§¶µ
Ctrl+' (Acute Accent and Right Quotes)
aeiouyAEIOUY'"
áéíóúýÁÉÍÓÚÝ’”
Ctrl+^ (Circumflex or Caron)
aeiouszAEIOUSZ
âêîôûšžÂÊÎÔÛŠŽ
Ctrl+: (Diaeresis)
aeiouyAEIOUY
äëïöüÿÄËÏÖÜŸ
Ctrl+~ (Tilde)
anoANO
ãñõÃÑÕ
Ctrl+@ (Å)
aA
åÅ
Ctrl+, (Ç)
cC
çÇ
Ctrl+/ (Ø and Fractions)
oO423
øØ¼½¾
Ctrl+& (Ligatures)
aosAO
æœßÆŒ
Ctrl+- (Thorn, Eth, Dashs and ±)
tdTDnm+
þðÞЖ—±
Ctrl+$ (Currency)
clpye*f
¢££¥€¤ƒ |
|
|
| Back to top |
|
 |
afromonkey0
Joined: 13 Oct 2007 Posts: 24
|
Posted: Sat Mar 01, 2008 12:24 pm Post subject: Nice |
|
|
That's a pretty neat implementation of an old idea. Nice and upgradable, and not many lines of code.
I use google docs now and i've been missing word's unicode characters, this works great. (I'm trying to add all of word's functionality to gdocs using AHK. could be here for a while )
I think i'll add in greek characters, i need them for physics notes. |
|
| Back to top |
|
 |
afromonkey0
Joined: 13 Oct 2007 Posts: 24
|
Posted: Sat Mar 01, 2008 12:48 pm Post subject: |
|
|
Well that didn't work.
Seems autohotkey can only read ANSI encoded scripts, and most greek letters are unicode.  |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4078 Location: Pittsburgh
|
Posted: Sat Mar 01, 2008 3:39 pm Post subject: |
|
|
| You can use Unicode in AHK, just search the Forum. E.g. you can select them, copy to Clipboard, transform to UTF-8, process and send back Unicode (see one example here). |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|