summaryrefslogtreecommitdiff
path: root/src/dev/ps2/keyboard.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2018-04-09 18:35:30 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2018-04-17 08:46:33 +0000
commit0f7710d4f7898e1244774d7158786639ae1131f4 (patch)
treead8eb6fc46fbb9a3ad4a44ddcbfbdbaa9e453e1a /src/dev/ps2/keyboard.hh
parent18f62ac208a3fc8d385e66c3b5ff22473229d1d7 (diff)
downloadgem5-0f7710d4f7898e1244774d7158786639ae1131f4.tar.xz
ps2: Add VNC support to the keyboard model
Add support for keyboard input from the VNC server in the PS/2 keyboard model. The introduced code is based on the functionality in the Arm PL050 KMI model. Change-Id: If04a9713e5a15e2149d1a7471b999e3060d8ee7d Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/9763 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/dev/ps2/keyboard.hh')
-rw-r--r--src/dev/ps2/keyboard.hh12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/dev/ps2/keyboard.hh b/src/dev/ps2/keyboard.hh
index 8943e7fcb..f5d83049f 100644
--- a/src/dev/ps2/keyboard.hh
+++ b/src/dev/ps2/keyboard.hh
@@ -44,11 +44,12 @@
#ifndef __DEV_PS2_KEYBOARD_HH__
#define __DEV_PS2_KEYBOARD_HH__
+#include "base/vnc/vncinput.hh"
#include "dev/ps2/device.hh"
struct PS2KeyboardParams;
-class PS2Keyboard : public PS2Device
+class PS2Keyboard : public PS2Device, VncKeyboard
{
protected:
static const uint8_t ID[];
@@ -78,6 +79,12 @@ class PS2Keyboard : public PS2Device
uint16_t lastCommand;
+ /** is the shift key currently down */
+ bool shiftDown;
+
+ /** Is the device enabled? */
+ bool enabled;
+
public:
PS2Keyboard(const PS2KeyboardParams *p);
@@ -86,6 +93,9 @@ class PS2Keyboard : public PS2Device
protected: // PS2Device
void recv(uint8_t data) override;
+
+ public: // VncKeyboard
+ void keyPress(uint32_t key, bool down) override;
};
#endif // __DEV_PS2_KEYBOARD_hH__