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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [services/] [gfx/] [mw/] [v2_0/] [src/] [engine/] [devkbd.c] - Blame information for rev 174

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
/*
2
 * Copyright (c) 1999 Greg Haerr <greg@censoft.com>
3
 *
4
 * Device-independent keyboard routines
5
 */
6
#include "device.h"
7
 
8
/*
9
 * Open the keyboard.
10
 */
11
int
12
GdOpenKeyboard(void)
13
{
14
        int     fd;
15
 
16
        if ((fd = kbddev.Open(&kbddev)) == -1)
17
                return -1;
18
 
19
        /* possible -2 return means no kbd*/
20
        return fd;
21
}
22
 
23
/*
24
 * Close the keyboard.
25
 */
26
void
27
GdCloseKeyboard(void)
28
{
29
        kbddev.Close();
30
}
31
 
32
/*
33
 * Return the possible modifiers for the keyboard.
34
 */
35
void
36
GdGetModifierInfo(MWKEYMOD *modifiers, MWKEYMOD *curmodifiers)
37
{
38
        kbddev.GetModifierInfo(modifiers, curmodifiers);
39
}
40
 
41
/*
42
 * This reads one keystroke from the keyboard, and the current state of
43
 * the mode keys (ALT, SHIFT, CTRL).  Returns -1 on error, 0 if no data
44
 * is ready, 1 if keypress, 2 if keyrelease.
45
 * This is a non-blocking call.  Returns -2 if ESC pressed.
46
 */
47
int
48
GdReadKeyboard(MWKEY *buf, MWKEYMOD *modifiers, MWSCANCODE *scancode)
49
{
50
        return kbddev.Read(buf, modifiers, scancode);
51
}

powered by: WebSVN 2.1.0

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