~ubuntu-branches/ubuntu/lucid/newt/lucid

« back to all changes in this revision

Viewing changes to showkey.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2005-03-22 12:44:37 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050322124437-nuhl0pqjcijjno9z
Tags: 0.51.6-20ubuntu3
Add Xhosa translation (thanks, Adi Attar).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <stdio.h>
2
 
#include <slang.h>
3
 
 
4
 
int main(void) {
5
 
    char n = 0;
6
 
    int i;
7
 
    char * buf;
8
 
 
9
 
    SLtt_get_terminfo();
10
 
    SLang_init_tty(4, 0, 0);
11
 
 
12
 
    buf = SLtt_tgetstr("ku");
13
 
    if (!buf) {
14
 
        printf("termcap entry not found for kl\n\r");
15
 
    } else {
16
 
        printf("termcap entry found for kl: %s", buf);
17
 
        while (*buf) {
18
 
            printf("0x%02x ", *buf++);
19
 
        }
20
 
        printf("\n\r");
21
 
    }
22
 
 
23
 
    printf("\n\r");
24
 
 
25
 
    printf("Press a key: ");
26
 
    fflush(stdout);
27
 
   
28
 
    SLang_input_pending(50);
29
 
 
30
 
    printf("\n\r");
31
 
    printf("You pressed: ");
32
 
 
33
 
    while (SLang_input_pending(1)) {
34
 
        i = SLang_getkey();
35
 
        printf("0x%02x ", i);
36
 
    }
37
 
 
38
 
    printf("\n\r");
39
 
 
40
 
    SLang_reset_tty();
41
 
}