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 
26 class Keyboard
27 {
28  public:
29  enum KeyFlags
30  {
31  Special = 1ULL << 63,
32  Ctrl = 1ULL << 62,
33  Shift = 1ULL << 61,
34  Alt = 1ULL << 60,
35  AltGr = 1ULL << 59
36  };
37 
40  {
42  ScrollLock = 1 << 0,
43 
45  NumLock = 1 << 1,
46 
48  CapsLock = 1 << 2,
49 
52  Led1 = 1 << 3,
53  Led2 = 1 << 4,
54  Led3 = 1 << 5,
55  Led4 = 1 << 6,
56  Led5 = 1 << 7,
57  };
58 
59  Keyboard();
60  virtual ~Keyboard();
61 
65  virtual void initialise() = 0;
66 
82  virtual void setDebugState(bool enableDebugState) = 0;
83  virtual bool getDebugState() = 0;
84 
91  virtual char getChar() = 0;
92 
99  virtual char getCharNonBlock() = 0;
100 
106  virtual char getLedState();
107 
112  virtual void setLedState(char state);
113 };
114 
115 #endif
virtual void initialise()=0
virtual char getChar()=0
virtual char getCharNonBlock()=0
virtual void setLedState(char state)
Definition: Keyboard.cc:30
KeyboardLeds
Bit numbers follow the same format as the PS/2 keyboard LED byte.
virtual void setDebugState(bool enableDebugState)=0
virtual char getLedState()
Definition: Keyboard.cc:25