Changeset 56fa418 in mainline for uspace/app/bdsh/input.c
- Timestamp:
- 2009-04-05T15:50:53Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade
- Children:
- 0175246
- Parents:
- 726ef849
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/input.c
r726ef849 r56fa418 35 35 #include <io/stream.h> 36 36 #include <console.h> 37 #include <kbd/kbd.h> 38 #include <kbd/keycode.h> 37 39 38 40 #include "config.h" … … 97 99 static void read_line(char *buffer, int n) 98 100 { 99 char c;101 kbd_event_t ev; 100 102 int chars; 101 103 102 104 chars = 0; 103 105 while (chars < n - 1) { 104 c = getchar();105 if ( c< 0)106 fflush(stdout); 107 if (kbd_get_event(&ev) < 0) 106 108 return; 107 if (c == '\n') 109 if (ev.type == KE_RELEASE) 110 continue; 111 112 if (ev.key == KC_ENTER || ev.key == KC_NENTER) 108 113 break; 109 if ( c == '\b') {114 if (ev.key == KC_BACKSPACE) { 110 115 if (chars > 0) { 111 116 putchar('\b'); … … 114 119 continue; 115 120 } 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; 119 125 } 120 126 }
Note:
See TracChangeset
for help on using the changeset viewer.