24 #include <linux/kernel.h>
25 #include <linux/module.h>
34 #include <linux/keyboard.h>
36 #include <linux/input.h>
51 static void beep(
unsigned int freq)
59 #define BRAILLE_KEY KEY_INSERT
61 static int console_cursor;
64 static int vc_x, vc_y, lastvc_x, lastvc_y;
67 static int console_show = 1;
69 static int console_newline = 1;
70 static int lastVC = -1;
72 static struct console *braille_co;
75 static void braille_write(
u16 *
buf)
98 for (i = 0; i <
WIDTH; i++) {
102 else if (out == 0x00)
119 braille_co->
write(braille_co, data,
c - data);
123 static void vc_follow_cursor(
struct vc_data *
vc)
132 static void vc_maybe_cursor_moved(
struct vc_data *
vc)
134 if (vc->
vc_x != lastvc_x || vc->
vc_y != lastvc_y)
135 vc_follow_cursor(vc);
139 static void vc_refresh(
struct vc_data *vc)
144 for (i = 0; i <
WIDTH; i++) {
157 unsigned long code,
void *_param)
172 vc_maybe_cursor_moved(vc);
178 switch (param->
value) {
183 braille_write(console_buf);
190 }
else if (vc_y >= 1) {
198 if (vc_x + WIDTH < vc->
vc_cols) {
200 }
else if (vc_y + 1 < vc->
vc_rows) {
220 vc_follow_cursor(vc);
234 if (ret == NOTIFY_STOP)
238 case KBD_POST_KEYSYM:
258 else if (on_off == 0)
262 case KBD_UNBOUND_KEYCODE:
272 .notifier_call = keyboard_notifier_call,
276 unsigned long code,
void *_param)
287 unsigned char c = param->
c;
293 if (console_cursor > 0) {
295 console_buf[console_cursor] =
' ';
311 if (console_newline) {
312 memset(console_buf, 0,
sizeof(console_buf));
316 if (console_cursor == WIDTH)
317 memmove(console_buf, &console_buf[1],
318 (WIDTH-1) *
sizeof(*console_buf));
321 console_buf[console_cursor-1] =
c;
325 braille_write(console_buf);
327 vc_maybe_cursor_moved(vc);
335 if (vc->
vc_num != lastVC) {
337 memset(console_buf, 0,
sizeof(console_buf));
339 braille_write(console_buf);
342 vc_maybe_cursor_moved(vc);
351 .notifier_call = vt_notifier_call,
359 char *console_options,
char *braille_options)
362 if (!console_options)
364 console_options =
"57600o8";
367 if (console->
setup) {
368 ret = console->
setup(console, console_options);
382 if (braille_co != console)