OOStuBS - Technische Informatik II (TI-II)
2.4
Hauptseite
Zusätzliche Informationen
Klassen
Dateien
Auflistung der Dateien
Datei-Elemente
src
device
keyboard.cc
gehe zur Dokumentation dieser Datei
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
2
* Technische Informatik II *
3
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
4
* *
5
* K E Y B O A R D *
6
* *
7
\* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
8
9
/* * * * * * * * * * * * * * * * * * * * * * * * *\
10
# INCLUDES #
11
\* * * * * * * * * * * * * * * * * * * * * * * * */
12
#include "
device/keyboard.h
"
13
#include "
object/imanager.h
"
14
#include "
object/log.h
"
15
16
/* * * * * * * * * * * * * * * * * * * * * * * * *\
17
# METHODS #
18
\* * * * * * * * * * * * * * * * * * * * * * * * */
19
Keyboard::Keyboard
() : sem(0){
20
21
}
22
23
void
Keyboard::plugin
(){
24
iManager
.
assign
(
InterruptManager::keyboard
, *
this
);
25
}
26
27
void
Keyboard::trigger
(){
28
k
=
key_hit
();
29
if
(
k
.
valid
()){
30
if
(
k
.
scancode
()==
Key::scan::del
&&
k
.
alt
() &&
k
.
ctrl
()){
31
reboot
();
32
}
else
33
sem
.
interrupt_signal
();
34
}
35
}
36
37
Key
Keyboard::getkey
()
38
{
39
log
<<
"Thread stored in Waitingroom "
<<
endl
;
40
sem
.
wait
();
41
return
k
;
42
}
Erzeugt am Mon Jun 30 2014 07:13:28 für OOStuBS - Technische Informatik II (TI-II) von
1.8.1.2