3
;;; $Id: key-w32.scm,v 1.3 1999/01/02 06:11:34 cph Exp $
5
;;; Copyright (c) 1991-1999 Massachusetts Institute of Technology
7
;;; This program is free software; you can redistribute it and/or
8
;;; modify it under the terms of the GNU General Public License as
9
;;; published by the Free Software Foundation; either version 2 of the
10
;;; License, or (at your option) any later version.
12
;;; This program is distributed in the hope that it will be useful,
13
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
;;; General Public License for more details.
17
;;; You should have received a copy of the GNU General Public License
18
;;; along with this program; if not, write to the Free Software
19
;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23
;;; Package: (edwin win32-keys)
25
(declare (usual-integrations))
27
(define (initialize-package!)
28
(set! end (make-special-key 'END 0))
33
(define (win32-make-special-key keysym bucky-bits)
34
(cond ((vk-code->name keysym)
36
(make-special-key name bucky-bits)))
39
(define (vk-code->name vk-code)
40
(vector-ref win32-key-translation-vector vk-code))
42
;; This constructs a vector mapping VK_* codes (integers 0..255) to
43
;; special key names (symbols). It doesn not include keys that are
44
;; affected by the Win32 API TranslateMessage, which are: any printing
45
;; character, backspace, enter, escape, tab
47
(define win32-key-translation-vector
48
(let ((v (make-vector 256 #f)))
49
(for-each (lambda (def)
50
(if (not (null? (cddr def)))
51
(vector-set! v (second def) (third def))))
52
'(;;VK_name code special-key name
81
(VK_SELECT #x29 select)
85
(VK_INSERT #x2D insertchar)
86
(VK_DELETE #x2E deletechar)
148
(VK_OEM_CLEAR #xFE)))
b'\\ No newline at end of file'