1 ;; copyright 2003 stefan kersten <steve@k-hornz.de>
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.
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
18 ;; (defvar sclang-key-table (make-char-table 'foo))
20 ;; (defun sclang-define-key (char beg end)
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 ()
34 (clear-this-command-keys)
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
))))))