Changeset 56fa418 in mainline for uspace/app/bdsh/input.c


Ignore:
Timestamp:
2009-04-05T15:50:53Z (15 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0175246
Parents:
726ef849
Message:

Make Czech layout work partially in bdsh.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/input.c

    r726ef849 r56fa418  
    3535#include <io/stream.h>
    3636#include <console.h>
     37#include <kbd/kbd.h>
     38#include <kbd/keycode.h>
    3739
    3840#include "config.h"
     
    9799static void read_line(char *buffer, int n)
    98100{
    99         char c;
     101        kbd_event_t ev;
    100102        int chars;
    101103
    102104        chars = 0;
    103105        while (chars < n - 1) {
    104                 c = getchar();
    105                 if (c < 0)
     106                fflush(stdout);
     107                if (kbd_get_event(&ev) < 0)
    106108                        return;
    107                 if (c == '\n')
     109                if (ev.type == KE_RELEASE)
     110                        continue;
     111
     112                if (ev.key == KC_ENTER || ev.key == KC_NENTER)
    108113                        break;
    109                 if (c == '\b') {
     114                if (ev.key == KC_BACKSPACE) {
    110115                        if (chars > 0) {
    111116                                putchar('\b');
     
    114119                        continue;
    115120                }
    116                 if (c >= ' ') {
    117                         putchar(c);
    118                         buffer[chars++] = c;
     121                if (ev.c >= ' ') {
     122                        //putchar(ev.c);
     123                        console_putchar(ev.c);
     124                        buffer[chars++] = ev.c;
    119125                }
    120126        }
Note: See TracChangeset for help on using the changeset viewer.