OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [MW_0_8_9PRE7/] [mw/] [src/] [drivers/] [kbd_null.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 673 markom
/*
2
 * Copyright (c) 2000 Greg Haerr <greg@censoft.com>
3
 *
4
 * Null Keyboard Driver
5
 */
6
#include <stdio.h>
7
#include "device.h"
8
 
9
static int  NUL_Open(KBDDEVICE *pkd);
10
static void NUL_Close(void);
11
static void NUL_GetModifierInfo(MWKEYMOD *modifiers, MWKEYMOD *curmodifiers);
12
static int  NUL_Read(MWUCHAR *buf, MWKEYMOD *modifiers, MWSCANCODE *scancode);
13
static int  NUL_Poll(void);
14
 
15
KBDDEVICE kbddev = {
16
        NUL_Open,
17
        NUL_Close,
18
        NUL_GetModifierInfo,
19
        NUL_Read,
20
        NUL_Poll
21
};
22
 
23
/*
24
 * Poll for keyboard events
25
 */
26
static int
27
NUL_Poll(void)
28
{
29
        return 0;
30
}
31
 
32
/*
33
 * Open the keyboard.
34
 */
35
static int
36
NUL_Open(KBDDEVICE *pkd)
37
{
38
        return -2;      /* no kbd*/
39
}
40
 
41
/*
42
 * Close the keyboard.
43
 */
44
static void
45
NUL_Close(void)
46
{
47
}
48
 
49
/*
50
 * Return the possible modifiers for the keyboard.
51
 */
52
static  void
53
NUL_GetModifierInfo(MWKEYMOD *modifiers, MWKEYMOD *curmodifiers)
54
{
55
        if (modifiers)
56
                *modifiers = 0;          /* no modifiers available */
57
        if (curmodifiers)
58
                *curmodifiers = 0;
59
}
60
 
61
/*
62
 * This reads one keystroke from the keyboard, and the current state of
63
 * the modifier keys (ALT, SHIFT, etc).  Returns -1 on error, 0 if no data
64
 * is ready, 1 on a keypress, and 2 on keyrelease.
65
 * This is a non-blocking call.
66
 */
67
static int
68
NUL_Read(MWKEY *buf, MWKEYMOD *modifiers, MWSCANCODE *scancode)
69
{
70
        return 0;
71
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.