Jump to content

Keyboard macros: Difference between revisions

Added EchoLisp
(Adds Clojure solution)
(Added EchoLisp)
Line 142:
pack!
show!)))
</lang>
 
=={{header|EchoLisp}}==
The '''(meta-key "key-value" "bound-string")''' function binds a modifier+key keypress to a string or function call.
<lang lisp>
;; see initial bindings : GREEK DICTIONARY
(meta-keys) → (("0" "❌") ("1" "❗️") ("2" "❓") ("3" "✔️") ("4" "⛔️") ("5" "✅") ("6" "🚩") ("7" "⌚️")
("8" "🏁") ("9" "😜") ("a" "α") ("b" "β") ("g" "γ") ("d" "δ") ("e" "ε") ("z" "ζ") ("h" "η") ("t" "τ")
("i" "ι") ("k" "κ") ("l" "λ") ("m" "μ") ("n" "ν") ("x" "ξ") ("q" "ο") ("p" "π") ("r" "ρ") ("w" "ς")
("s" "σ") ("u" "υ") ("f" "φ") ("c" "χ") ("y" "ψ") ("o" "ω") ("A" "Α") ("B" "Β") ("G" "Γ") ("D" "Δ")
("E" "Ε") ("Z" "Ζ") ("H" "Η") ("T" "Τ") ("I" "Ι") ("K" "Κ") ("L" "Λ") ("M" "Μ") ("N" "Ν") ("X" "Ξ") ("Q" "Ο") ("P" "Π") ("R" "Ρ") ("S" "Σ") ("U" "Υ") ("F" "Φ") ("C" "Χ") ("Y" "Ψ") ("O" "Ω"))
 
;; define modifier to use : Control key
(define-modifier-key "ctrl")
 
;; type : ctrl-R, ctrl-O, ...
- ΡΩΣΕΤΤΑ
 
;; custom bindings
(meta-key "A" "Antoinette") ; string
(meta-key "H" "(begin (writeln 'HELLO) (date 'today))") ; function call
</lang>
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.