Subversion Repositories HelenOS

Rev

Rev 4419 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4419 Rev 4537
Line 30... Line 30...
30
 * @ingroup kbd
30
 * @ingroup kbd
31
 * @{
31
 * @{
32
 */
32
 */
33
/**
33
/**
34
 * @file
34
 * @file
35
 * @brief   PC keyboard controller driver.
35
 * @brief PC keyboard controller driver.
36
 */
36
 */
37
 
37
 
38
#include <kbd.h>
38
#include <kbd.h>
39
#include <kbd/kbd.h>
39
#include <io/console.h>
40
#include <kbd/keycode.h>
40
#include <io/keycode.h>
41
#include <kbd_ctl.h>
41
#include <kbd_ctl.h>
42
#include <gsp.h>
42
#include <gsp.h>
43
 
43
 
44
enum dec_state {
44
enum dec_state {
45
    ds_s,
45
    ds_s,
Line 186... Line 186...
186
    return 0;
186
    return 0;
187
}
187
}
188
 
188
 
189
void kbd_ctl_parse_scancode(int scancode)
189
void kbd_ctl_parse_scancode(int scancode)
190
{
190
{
191
    kbd_ev_type_t type;
191
    console_ev_type_t type;
192
    unsigned int key;
192
    unsigned int key;
193
    int *map;
193
    int *map;
194
    size_t map_length;
194
    size_t map_length;
195
 
195
 
196
    if (scancode == 0xe0) {
196
    if (scancode == 0xe0) {
Line 211... Line 211...
211
 
211
 
212
    ds = ds_s;
212
    ds = ds_s;
213
 
213
 
214
    if (scancode & 0x80) {
214
    if (scancode & 0x80) {
215
        scancode &= ~0x80;
215
        scancode &= ~0x80;
216
        type = KE_RELEASE;
216
        type = KEY_RELEASE;
217
    } else {
217
    } else {
218
        type = KE_PRESS;
218
        type = KEY_PRESS;
219
    }
219
    }
220
 
220
 
221
    if (scancode < 0 || scancode >= map_length)
221
    if (scancode < 0 || scancode >= map_length)
222
        return;
222
        return;
223
 
223