keyboard.hh (12653:4f6b6c1a8e2f) keyboard.hh (12654:749de33b7af6)
1/*
2 * Copyright (c) 2017-2018 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 30 unchanged lines hidden (view full) ---

39 *
40 * Authors: Gabe Black
41 * Andreas Sandberg
42 */
43
44#ifndef __DEV_PS2_KEYBOARD_HH__
45#define __DEV_PS2_KEYBOARD_HH__
46
1/*
2 * Copyright (c) 2017-2018 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 30 unchanged lines hidden (view full) ---

39 *
40 * Authors: Gabe Black
41 * Andreas Sandberg
42 */
43
44#ifndef __DEV_PS2_KEYBOARD_HH__
45#define __DEV_PS2_KEYBOARD_HH__
46
47#include "base/vnc/vncinput.hh"
47#include "dev/ps2/device.hh"
48
49struct PS2KeyboardParams;
50
48#include "dev/ps2/device.hh"
49
50struct PS2KeyboardParams;
51
51class PS2Keyboard : public PS2Device
52class PS2Keyboard : public PS2Device, VncKeyboard
52{
53 protected:
54 static const uint8_t ID[];
55
56 enum Command
57 {
58 LEDWrite = 0xED,
59 DiagnosticEcho = 0xEE,

--- 13 unchanged lines hidden (view full) ---

73 Resend = 0xFE,
74 Reset = 0xFF
75 };
76 static const uint16_t NoCommand = (uint16_t)(-1);
77
78
79 uint16_t lastCommand;
80
53{
54 protected:
55 static const uint8_t ID[];
56
57 enum Command
58 {
59 LEDWrite = 0xED,
60 DiagnosticEcho = 0xEE,

--- 13 unchanged lines hidden (view full) ---

74 Resend = 0xFE,
75 Reset = 0xFF
76 };
77 static const uint16_t NoCommand = (uint16_t)(-1);
78
79
80 uint16_t lastCommand;
81
82 /** is the shift key currently down */
83 bool shiftDown;
84
85 /** Is the device enabled? */
86 bool enabled;
87
81 public:
82 PS2Keyboard(const PS2KeyboardParams *p);
83
84 void serialize(CheckpointOut &cp) const override;
85 void unserialize(CheckpointIn &cp) override;
86
87 protected: // PS2Device
88 void recv(uint8_t data) override;
88 public:
89 PS2Keyboard(const PS2KeyboardParams *p);
90
91 void serialize(CheckpointOut &cp) const override;
92 void unserialize(CheckpointIn &cp) override;
93
94 protected: // PS2Device
95 void recv(uint8_t data) override;
96
97 public: // VncKeyboard
98 void keyPress(uint32_t key, bool down) override;
89};
90
91#endif // __DEV_PS2_KEYBOARD_hH__
92
99};
100
101#endif // __DEV_PS2_KEYBOARD_hH__
102