$$::Strike2("€") $'::Strike2("’") $`::Strike2("´") $%::Strike2("§") $"::Strike2("”") $*::Strike2("•") $x::Strike2("×") $+::Strike2("±") $-::Strike2("–") $.::Strike2("…") $,::Strike2("„") $/::Strike2("÷") $|::Strike2("¦") $0::Strike2("º") $1::Strike2("¹") $2::Strike2("²") $3::Strike2("³") $4::Strike2("¼") $5::Strike2("½") $6::Strike2("¾") $<::Strike2("«") $>::Strike2("»") $+A::Strike2("Á") $+Q::Strike2("Ä") $+E::Strike2("É") $+I::Strike2("Í") $+L::Strike2("£") $+O::Strike2("Ó") $+P::Strike2("Ö") $+{::Strike2("Õ") $+U::Strike2("Ú") $+Y::Strike2("Ü") $+T::Strike2("Û") $a::Strike2("á") $q::Strike2("ä") $e::Strike2("é") $f::Strike2("ƒ") $i::Strike2("í") $m::Strike2("µ") $s::Strike2("ß") $o::Strike2("ó") $p::Strike2("ö") $[::Strike2("õ") $u::Strike2("ú") $y::Strike2("ü") $t::Strike2("û") Strike2(ch) ; If hotkey was activated twice within 200 ms { ; Send ch, else send activating hotkey If (!keywas and A_ThisHotkey = A_PriorHotkey and A_TimeSincePriorHotkey < 200) { Send {BS}%ch% ; erase char, Send replacement keywas = 1 ; key got replaced, next press is normal } Else { StringRight key, A_ThisHotkey, 1 SendRaw %key% ; Send activating key keywas = 0 ; normal key press, next can be replaced } }The very first line replaces $$ with € (the Euro symbol), but it does not show up right in the code listing.
Fast replacing keyboard
Started by
Laszlo
, Aug 01 2005 11:34 PM
5 replies to this topic
The latest AHK release (1.0.37.04) allows the use of the printed-on key names in hotkeys. This greatly simplifies the fastest keyboard modifier script for typing special ANSI characters. The script below activates a function at pressing the same designated keys twice in rapid succession, to send another character to the foreground application (or do whatever you want). You have to learn paying attention, though. If "ss" often occurs in your language, replacing quickly typed ones could be annoying. Seldom doubled keys are safer, like "," or "\". Keep from the large set of replacement rules below, what you really need, or add more diacritical letters!
#1
-
Posted 01 August 2005 - 11:34 PM
Hi,
This script is very handy. As I type in spanish, french on the same english keybord.
Problem is, when I type CAPSLOCK, HeRe is WHat HappeNs
it seems aLL Keys iNCLuDeD iN tHe sCRipt aRe tuRNeD to LoWeR Case.
HeRe is tHe CoNteNt of my fReNCH KeyBoaRD: "aZeRtyuiopqsDfGHJKLmWxCVBN"
Any solution?
Thanks for a great tool anyway
This script is very handy. As I type in spanish, french on the same english keybord.
Problem is, when I type CAPSLOCK, HeRe is WHat HappeNs
it seems aLL Keys iNCLuDeD iN tHe sCRipt aRe tuRNeD to LoWeR Case.
HeRe is tHe CoNteNt of my fReNCH KeyBoaRD: "aZeRtyuiopqsDfGHJKLmWxCVBN"
Any solution?
Thanks for a great tool anyway
#2
-
Posted 25 February 2008 - 09:48 PM
Try replacing the Strike2() function definition with this:
Strike2(ch) { ; If hotkey activated twice within 200 ms Send ch, else send activating hotkey Static keywas If (!keywas && A_ThisHotkey = A_PriorHotkey && A_TimeSincePriorHotkey < 200) { If GetKeyState("CapsLock", "T") IF GetKeyState("Shift", "P") StringLower Ch, Ch Else StringUpper Ch, Ch Send {BS}%ch% ; erase char, Send replacement keywas = 1 ; key got replaced, next press is normal } Else { StringRight key, A_ThisHotkey, 1 If GetKeyState("CapsLock", "T") IF GetKeyState("Shift", "P") StringLower key, key Else StringUpper key, key SendRaw %key% ; Send activating key keywas = 0 ; normal key press, next can be replaced } }
#3
-
Posted 25 February 2008 - 10:27 PM
Thanks a lot for this script
It is rather simple but helps me a lot. I adopt it right now.
I especially use the French / Spanish keyboards and find it very handy.
It is rather simple but helps me a lot. I adopt it right now.
I especially use the French / Spanish keyboards and find it very handy.
#4
-
Posted 17 November 2008 - 11:07 AM
By the way, do you see how to correct this:
With this script, when à type C R O ^ U T E, I get croû^te instead of croûte, as I should normally get wihtout the script.
Any idea?
Thx
With this script, when à type C R O ^ U T E, I get croû^te instead of croûte, as I should normally get wihtout the script.
Any idea?
Thx
#5
-
Posted 12 December 2008 - 08:55 AM
You have two conflicting keyboard managers. If you disable the deadkeys, key combinations in your keyboard layout, but use AHK hotstrings instead, you would have a more flexible keyboard driver, without conflicts.
#6
-
Posted 12 December 2008 - 04:23 PM