Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; adds Windows + f as an IPA hotkey
- ; once in IPA mode, press a letter to cycle through IPA symbols (see KEYS below)
- ; then hit another key (e.g. right arrow or space) to select that symbol
- ; e.g. to type æ type: windows + f > a > a > right arrow
- ; comments: luke@sawczak.com
- ; last updated 2020-08-13
- ; KEYS
- ; a = ɑ æ ɐ ɑ̃
- ; b = β ɓ ʙ
- ; c = ɕ ç
- ; d = ð d͡ʒ ɖ ɗ
- ; e = ə ɚ ɵ ɘ
- ; f = ɛ ɜ ɝ ɛ̃ ɞ
- ; g = ɠ ɢ ʛ
- ; h = ɥ ɦ ħ ɧ ʜ
- ; i = ɪ ɪ̈ ɨ
- ; j = ʝ ɟ ʄ
- ; k = ʔ ʕ ʢ ʡ
- ; l = ɫ ɬ ʟ ɭ ɮ
- ; m = ɱ
- ; n = ŋ ɲ ɴ ɳ
- ; o = ɔ œ ø ɒ ɔ̃ ɶ œ̃
- ; p = ɸ
- ; q = "ˈ "ˌ | ‖ ∅
- ; r = ɾ ʁ ɹ ɻ ʀ ɽ ɺ
- ; s = ʃ ʂ
- ; t = θ t͡ʃ t͡s ʈ
- ; u = ʊ ʊ̈ ʉ
- ; v = ʌ ʋ ⱱ
- ; w = ʍ ɯ ɰ
- ; x = χ
- ; y = ʎ ɣ ʏ ɤ
- ; z = ʒ ʐ ʑ
- #NoTrayIcon
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- KEYS := {"a": ["ɑ", "æ", "ɐ", "ɑ̃"],"b": ["β", "ɓ", "ʙ"],"c": ["ɕ", "ç"],"d": ["ð", "d͡ʒ", "ɖ", "ɗ"],"e": ["ə", "ɚ", "ɵ", "ɘ"],"f": ["ɛ", "ɜ", "ɝ", "ɛ̃", "ɞ"],"g": ["ɠ", "ɢ", "ʛ"],"h": ["ɥ", "ɦ", "ħ", "ɧ", "ʜ"],"i": ["ɪ", "ɪ̈", "ɨ"],"j": ["ʝ", "ɟ", "ʄ"], "k": ["ʔ", "ʕ", "ʢ", "ʡ"],"l": ["ɫ", "ɬ", "ʟ", "ɭ", "ɮ"],"m": ["ɱ"], "n": ["ŋ", "ɲ", "ɴ", "ɳ"],"o": ["ɔ", "œ", "ø", "ɒ", "ɔ̃", "ɶ", "œ̃"],"p": ["ɸ"],"q": ["ˈ", "ˌ", "|", "‖", "∅"],"r": ["ɾ", "ʁ", "ɹ", "ɻ", "ʀ", "ɽ", "ɺ"],"s": ["ʃ", "ʂ"],"t": ["θ", "t͡ʃ", "t͡s", "ʈ"],"u": ["ʊ", "ʊ̈", "ʉ"],"v": ["ʌ", "ʋ", "ⱱ"],"w": ["ʍ", "ɯ", "ɰ"],"x": ["χ"],"y": ["ʎ", "ɣ", "ʏ", "ɤ"],"z": ["ʒ", "ʐ", "ʑ"]}
- DIRECT := ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", " ", ",", ".", ";", "/", "[", "]", "-", "=", "\", "``", "'"]
- #f::
- caret_x = %A_CaretX%
- caret_y = %A_CaretY%
- caret_y += 50
- tooltip, Entering IPA symbol (type alphabetic letters; any other key to quit), caret_x, caret_y
- started := 0
- index := 1
- last := "-"
- entered := "-"
- while True {
- Input, key, L1, {RCtrl}{Enter}{Delete}{BackSpace}{Escape}{LAlt}{RAlt}{LShift}{RShift}{AppsKey}{F1}{F2}{F3}{F4}{F5}{F6}{F7}{F8}{F9}{F10}{F11}{F12}{Left}{Right}{Up}{Down}{Home}{End}{PgUp}{PgDn}{Ins}{Capslock}{Numlock}{PrintScreen}{Pause}{LWin}{RWin}
- for i, val in DIRECT {
- if (val = key) {
- tooltip,
- send % key
- return
- }
- }
- if (not (KEYS.HasKey(key))) {
- tooltip,
- return
- } else {
- if ((started = 1) and (key != last)) {
- send % key
- tooltip,
- return
- index := 1
- } else if (key = last) {
- index++
- }
- if ((index) > KEYS[key].MaxIndex()) {
- index := 1
- }
- if (started = 1) {
- Loop, % StrLen(entered) {
- send {BackSpace}
- }
- } else {
- started := 1
- }
- last := key
- entered := KEYS[key][index]
- send % entered
- }
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement