The Pedigree Project 0.1
include/pedigree/kernel/machine/Keyboard.h
1/*
2 * Copyright (c) 2008-2014, Pedigree Developers
3 *
4 * Please see the CONTRIB file in the root of the source tree for a full
5 * list of contributors.
6 *
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19
20#ifndef MACHINE_KEYBOARD_H
21#define MACHINE_KEYBOARD_H
22
26class Keyboard {
27 public:
28 enum KeyFlags {
29 Special = 1ULL << 63,
30 Ctrl = 1ULL << 62,
31 Shift = 1ULL << 61,
32 Alt = 1ULL << 60,
33 AltGr = 1ULL << 59
34 };
35
39 ScrollLock = 1 << 0,
40
42 NumLock = 1 << 1,
43
45 CapsLock = 1 << 2,
46
49 Led1 = 1 << 3,
50 Led2 = 1 << 4,
51 Led3 = 1 << 5,
52 Led4 = 1 << 6,
53 Led5 = 1 << 7,
54 };
55
56 Keyboard();
57 virtual ~Keyboard();
58
62 virtual void initialise() = 0;
63
74 virtual void setDebugState(bool enableDebugState) = 0;
75 virtual bool getDebugState() = 0;
76
83 virtual char getChar() = 0;
84
91 virtual char getCharNonBlock() = 0;
92
98 virtual char getLedState();
99
104 virtual void setLedState(char state);
105};
106
107#endif
virtual char getCharNonBlock()=0
virtual char getChar()=0
virtual void initialise()=0
KeyboardLeds
Bit numbers follow the same format as the PS/2 keyboard LED byte.
virtual void setLedState(char state)
Definition Keyboard.cc:29
virtual void setDebugState(bool enableDebugState)=0
virtual char getLedState()
Definition Keyboard.cc:25