cf20462abc
* BUG: Input: Comment all NoDelay related stuff out * BUG: Window: PrintCenter() handles empty lines now * NEW: Pair: Allocate all pairs at initialisation and inhibit any change to them. Array accessors can be used to get the pair number for a given fore-/background combination * NEW: Window: Rewrite the Window class * NEW: Remove the Insert() method * NEW: Remove .Window.Attrs' Color property * NEW: BorderFrame is an optional argument to the constructor (default True) to specify if there shall be a border frame around the window setting the border apart from the content * NEW: Ask() returns the choice number to ease translation * NEW: Ask() supports a default choice in upper case * NEW: Make Read event work * NEW: Screen: Rewrite it mostly (is a static class again) * NEW: Remove Read event * NEW: Make Resize event work * NEW: Rename .Cols and .Lines to .Width resp. .Height * NEW: Declare gb.ncurses "Unfinished" * OPT: Tidy up sources * OPT: Window: Use werase() instead of wclear() to clear [EXAMPLES] * NEW: Add 'Pong' in the Games section git-svn-id: svn://localhost/gambas/trunk@5543 867c0c6c-44f3-4631-809d-bfa615b0a4ec
63 lines
1.7 KiB
C
63 lines
1.7 KiB
C
/*
|
|
* c_input.h - gb.ncurses opaque input routines for use of either ncurses or
|
|
* the terminal driver directly
|
|
*
|
|
* Copyright (C) 2012 Tobias Boege <tobias@gambas-buch.de>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
* any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
* MA 02110-1301, USA.
|
|
*/
|
|
|
|
#ifndef __C_INPUT_H
|
|
#define __C_INPUT_H
|
|
|
|
#include "c_screen.h"
|
|
|
|
enum {
|
|
/* Return the current mode */
|
|
INPUT_RETURN = -1,
|
|
/* Line discipline, signal generation */
|
|
INPUT_COOKED,
|
|
/* No line discipline, signal generation */
|
|
INPUT_CBREAK,
|
|
/* No line discipline, no signal generation */
|
|
INPUT_RAW,
|
|
#if 0
|
|
/* Use terminal driver, enabled to use raw scancodes
|
|
(which are internally converted to ncurses keys but enable to
|
|
distinguish key press and release) */
|
|
INPUT_NODELAY
|
|
#endif
|
|
};
|
|
|
|
enum {
|
|
TIMEOUT_NOTIMEOUT = -1
|
|
};
|
|
|
|
#ifndef __C_INPUT_C
|
|
extern GB_DESC CInputDesc[];
|
|
#endif
|
|
|
|
int INPUT_init();
|
|
void INPUT_exit();
|
|
void INPUT_mode(CSCREEN *scr, int mode);
|
|
int INPUT_get(int);
|
|
void INPUT_drain();
|
|
#ifdef __C_INPUT_C
|
|
static void INPUT_watch(int);
|
|
static void INPUT_callback(int, int, intptr_t);
|
|
#endif
|
|
|
|
#endif /* __C_INPUT_H */
|