#include "../fb.h"
#include "fb_private_console.h"
#include <termcap.h>
Go to the source code of this file.
#define KEY_BUFFER_LEN 256 |
static void add_key |
( |
NODE ** |
node, |
|
|
char * |
key, |
|
|
short |
code |
|
) |
| |
|
static |
This builds a simple tree that allows fairly easy lookup of the terminal escape sequences (keys) that were added. For example:
after adding these key sequences:
[a1, [a2, [b1, [b2
the tree looks like: (| = child, - = sibling)
root -> <[>
|
<b>-----------<a>
| |
<2>----<1> <2>----<1>
Definition at line 59 of file io_inkey.c.
int fb_ConsoleGetkey |
( |
void |
) | |
|
int fb_ConsoleKeyHit |
( |
void |
) | |
|
int fb_hGetCh |
( |
int |
remove) | |
|
static void init_keys |
( |
) | |
|
|
static |
Lookup the terminal escape sequences (termcap database entries) corresponding to the id strings defined in the key_data table above (only key presses here).
For example, the id string "kh" corresponds to the HOME key, and tgetstr("kh", NULL) returns the escape sequence that the terminal will send when the HOME key was pressed.
These typically vary from terminal to terminal (for example TERM=xterm vs. TERM=linux) and perhaps depend on other factors aswell.
Definition at line 99 of file io_inkey.c.