Created
June 2, 2016 06:07
-
-
Save ahungry/d8be8dca688aae05824ddee4122e90cd to your computer and use it in GitHub Desktop.
Revisions
-
ahungry created this gist
Jun 2, 2016 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ (defcommand wss (string) () "Send a string of characters, including non-ascii ones (needs work for more than 1 char at a time)" (map nil (lambda (ch) (let* ((char-code (char-code ch)) (keysym (+ char-code (if (>= char-code #x100) #x01000000 0)))) ;; Only applicable if code >= #x100 (xlib:change-keyboard-mapping *display* (make-array '(1 1) :initial-element keysym) ;;#2A( ;;#(16778171) ;; λ in slot 8 ;;#(16777618) ;; ƒ in slot 9 ;; ) :first-keycode 8) ;; todo - check for first free keycode that doesn't have a keysym vs assuming its #8 (xtest:fake-key-event *display* 8 t :delay 0) (xtest:fake-key-event *display* 8 nil :delay 1))) string)) (defcommand xdo-lambda () () (wss "λ")) ;;(run-shell-command "xdotool type λ")) (defcommand xdo-fn () () (wss "ƒ")) ;;(run-shell-command "xdotool type ƒ")) (defcommand xdo-alpha () () (wss "α")) ;;(run-shell-command "xdotool type α")) (defcommand xdo-arrow () () (wss "→")) ;;(run-shell-command "xdotool type →")) (defcommand xdo-psi () () (wss "ψ")) ;;(run-shell-command "xdotool type ψ")) (defcommand xdo-plus-minus () () (wss "±")) ;;(run-shell-command "xdotool type ±"))