Created
July 13, 2020 11:42
-
-
Save Metaxal/e13002ffb19e2d1fe4d98f7def8f8c0d to your computer and use it in GitHub Desktop.
Reuse global keymap functions for a custom keymap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define map-global-function | |
(let* ([km-global (keymap:get-global)] | |
[table (for/hash ([name (in-list (dict-values (send km-global get-map-function-table)))]) | |
(values name #t))]) | |
(λ (km key name) | |
(unless (dict-has-key? table name) | |
(error "Unknown function" name)) | |
(send km add-function name | |
(λ (in ev) | |
(send km-global call-function name in ev #t))) | |
(send km map-function key name)))) | |
(map-global-function my-keymap "c:backspace" "backward-kill-word") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
List of available functions:
Noteworthy: keyboard-macro*, TeX-compress, *-ascii-art-box