/[cl-ncurses]/trunk/getch.lisp
ViewVC logotype

Contents of /trunk/getch.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 18 - (show annotations)
Wed Jun 6 04:31:07 2007 UTC (6 years, 10 months ago) by jgabrielson
File size: 2416 byte(s)
get working on Win32 with pdcurses

1 ;;;; This file is part of cl-ncurses, an ncurses interface for Common Lisp,
2 ;;;; Copyright (c) 2003 Nikodemus Siivola
3 ;;;; Copyright (c) 2004 Marcelo Ramos <mramos@montevideo.com.uy>
4 ;;;;
5 ;;;; Permission is hereby granted, free of charge, to any person obtaining
6 ;;;; a copy of this software and associated documentation files (the
7 ;;;; "Software"), to deal in the Software without restriction, including
8 ;;;; without limitation the rights to use, copy, modify, merge, publish,
9 ;;;; distribute, sublicense, and/or sell copies of the Software, and to
10 ;;;; permit persons to whom the Software is furnished to do so, subject to
11 ;;;; the following conditions:
12 ;;;;
13 ;;;; The above copyright notice and this permission notice shall be included
14 ;;;; in all copies or substantial portions of the Software.
15 ;;;;
16 ;;;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 ;;;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 ;;;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 ;;;; IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 ;;;; CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21 ;;;; TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22 ;;;; SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24 ;;;;;;;;;;;
25 ;; GETCH ;;
26 ;;;;;;;;;;;
27
28 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
29 ;; Routines: getch, wgetch, mvgetch, mvwgetch, ungetch, has_key ;;
30 ;; Purpose: Get (or push back) characters from curses terminal keyboard ;;
31 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
32
33 (in-package :cl-ncurses)
34
35 ; C Prototype: int wgetch(WINDOW *win);
36 (def :int ((win window-ptr))
37 "wgetch")
38
39 ; C Prototype: int getch(void);
40 #-(or win32 mswindows) ;; macro in pdcurses
41 (def :int ()
42 "getch")
43
44 #+(or win32 mswindows)
45 (defun getch ()
46 (wgetch *stdscr*))
47
48 ; C Prototype: int mvgetch(int y, int x);
49 (def :int ((y :int)
50 (x :int))
51 "mvgetch")
52
53 ; C Prototype: int mvwgetch(WINDOW *win, int y, int x);
54 (def :int ((win window-ptr)
55 (y :int)
56 (x :int))
57 "mvwgetch")
58
59 ; C Prototype: int ungetch(int ch);
60 ; C Prototype: int has_key(int ch);
61 (def :int ((ch :int))
62 #-(or win32 mswindows)
63 "ungetch"
64 #+(or win32 mswindows)
65 "PDC_ungetch"
66 "has_key")
67
68 #+(or win32 mswindows)
69 (defun ungetch (ch)
70 (PDC_ungetch ch))
71
72
73

  ViewVC Help
Powered by ViewVC 1.1.5