1 | /* |
---|
2 | * The contents of this file were formerly in console.c which |
---|
3 | * had the following copyright notice: |
---|
4 | * |
---|
5 | * (C) Copyright 1997 |
---|
6 | * NavIST Group - Real-Time Distributed Systems and Industrial Automation |
---|
7 | * http://pandora.ist.utl.pt |
---|
8 | * Instituto Superior Tecnico * Lisboa * PORTUGAL |
---|
9 | * |
---|
10 | * The original code and subsequent modifications are: |
---|
11 | * |
---|
12 | * COPYRIGHT (c) 1989-2011. |
---|
13 | * On-Line Applications Research Corporation (OAR). |
---|
14 | * |
---|
15 | * The license and distribution terms for this file may be |
---|
16 | * found in the file LICENSE in this distribution or at |
---|
17 | * http://www.rtems.org/license/LICENSE. |
---|
18 | */ |
---|
19 | |
---|
20 | #include <rtems.h> |
---|
21 | #include <rtems/keyboard.h> |
---|
22 | #include <rtems/mw_uid.h> |
---|
23 | |
---|
24 | /* adds a kbd message to the queue */ |
---|
25 | static void kbd_parser( void *ptr, unsigned short keycode, unsigned long mods ) |
---|
26 | { |
---|
27 | struct MW_UID_MESSAGE m; |
---|
28 | struct kbd_struct * kbd = (struct kbd_struct *)ptr; |
---|
29 | |
---|
30 | m.type = MV_UID_KBD; |
---|
31 | m.m.kbd.code = keycode; |
---|
32 | m.m.kbd.modifiers = kbd->ledflagstate; |
---|
33 | m.m.kbd.mode = kbd->kbdmode; |
---|
34 | /* printk( "kbd: msg: keycode=%X, mod=%X\n", keycode, mods ); */ |
---|
35 | |
---|
36 | uid_send_message( &m ); |
---|
37 | } |
---|
38 | |
---|
39 | void register_kbd_msg_queue( char *q_name, int port ) |
---|
40 | { |
---|
41 | kbd_set_driver_handler( kbd_parser ); |
---|
42 | } |
---|
43 | |
---|
44 | void unregister_kbd_msg_queue( int port ) |
---|
45 | { |
---|
46 | kbd_set_driver_handler( NULL ); |
---|
47 | } |
---|