Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / editors / scel / el / sclang-keys.el
blob1acee63de1a2c08aa3eec04615f15e52e808dd00
1 ;; copyright 2003 stefan kersten <steve@k-hornz.de>
2 ;;
3 ;; This program is free software; you can redistribute it and/or
4 ;; modify it under the terms of the GNU General Public License as
5 ;; published by the Free Software Foundation; either version 2 of the
6 ;; License, or (at your option) any later version.
7 ;;
8 ;; This program is distributed in the hope that it will be useful, but
9 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
10 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 ;; General Public License for more details.
13 ;; You should have received a copy of the GNU General Public License
14 ;; along with this program; if not, write to the Free Software
15 ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
16 ;; USA
18 ;; (defvar sclang-key-table (make-char-table 'foo))
20 ;; (defun sclang-define-key (char beg end)
21 ;; (interactive)
22 ;; (sclang-eval-string (sclang-format "Emacs.defineKey(%o, %o)" char code))
23 ;; (define-key (char-to-string char) sclang-key-mode-map 'sclang-execute-key))
25 ;; (defun sclang-execute-key (char)
26 ;; (sclang-eval-string (sclang-format "Emacs.executeKey(%o)" char)))
28 (eval-and-compile (require 'sclang-util)
29 (require 'sclang-interp))
31 (defun sclang-read-keys ()
32 (interactive)
33 (let (char)
34 (clear-this-command-keys)
35 (while t
36 (setq char (read-event))
37 (clear-this-command-keys)
38 (when (characterp char)
39 (message "%s (%d)" (char-to-string char) char)
40 (sclang-eval-string (format "Emacs.keys.at(%d).value(%d)" char char))))))
42 ;; EOF