diff options
author | Arun Isaac | 2022-06-18 16:00:26 +0530 |
---|---|---|
committer | Arun Isaac | 2022-06-18 16:00:26 +0530 |
commit | 2e83b7a960c32be52130642bc48ce110c768c94c (patch) | |
tree | 10050de0522bdc076e1d1410d84bd40a46080331 | |
parent | 5edc8a43602296e30b61fbaaa09b1b27024b4190 (diff) | |
download | thogai-2e83b7a960c32be52130642bc48ce110c768c94c.tar.gz thogai-2e83b7a960c32be52130642bc48ce110c768c94c.tar.lz thogai-2e83b7a960c32be52130642bc48ce110c768c94c.zip |
Implement translations that simulate keypresses.
* thogai.el (thogai-insert-translation): Implement translations that
simulate keypresses.
-rw-r--r-- | thogai.el | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -347,6 +347,23 @@ External callers should always pass nil as the value." (save-excursion (left-word) (delete-char -1))) + ;; Key + ((pred (lambda (translation) + (member (downcase translation) + (list "{#left}" "{#right}" "{#up}" "{#down}" + "{#backspace}" "{#delete}" "{#return}" + "{#space}" "{#tab}")))) + (call-interactively + (key-binding + (kbd (pcase (downcase + (string-remove-prefix + "{#" (string-remove-suffix "}" translation))) + ("backspace" "DEL") + ("delete" "<deletechar>") + ("return" "RET") + ("space" "SPC") + ("tab" "TAB") + (key-name (concat "<" key-name ">"))))))) ;; Simple literal translation (_ (unless non-first-part-p |