47 #include "debug/PS2.hh" 49 #include "params/PS2Keyboard.hh" 57 p->vnc->setKeyboard(
this);
81 DPRINTF(PS2,
"Got keyboard read ID command.\n");
86 DPRINTF(PS2,
"Enabling the keyboard.\n");
91 DPRINTF(PS2,
"Disabling the keyboard.\n");
96 DPRINTF(PS2,
"Disabling and resetting the keyboard.\n");
101 DPRINTF(PS2,
"Resetting keyboard.\n");
107 panic(
"Keyboard resend unimplemented.\n");
110 if (data.size() == 1) {
111 DPRINTF(PS2,
"Got LED write command.\n");
116 "caps lock %s, num lock %s, scroll lock %s\n",
117 bits(data[1], 2) ?
"on" :
"off",
118 bits(data[1], 1) ?
"on" :
"off",
119 bits(data[1], 0) ?
"on" :
"off");
124 panic(
"Keyboard diagnostic echo unimplemented.\n");
126 panic(
"Accessing alternate scan codes unimplemented.\n");
128 if (data.size() == 1) {
129 DPRINTF(PS2,
"Setting typematic info.\n");
133 DPRINTF(PS2,
"Setting typematic info to %#02x.\n", data[1]);
138 panic(
"Setting all keys to typemantic unimplemented.\n");
140 panic(
"Setting all keys to make/release unimplemented.\n");
142 panic(
"Setting all keys to make unimplemented.\n");
144 panic(
"Setting all keys to " 145 "typematic/make/release unimplemented.\n");
147 panic(
"Setting a key to typematic unimplemented.\n");
149 panic(
"Setting a key to make/release unimplemented.\n");
151 panic(
"Setting key to make only unimplemented.\n");
153 panic(
"Unknown keyboard command %#02x.\n", data[0]);
173 for (uint8_t
c : keys)
179 PS2KeyboardParams::create()
#define panic(...)
This implements a cprintf based panic() function.
bool recv(const std::vector< uint8_t > &data) override
Data received from host.
PS2Keyboard(const PS2KeyboardParams *p)
void sendAck()
Send an ACK byte to the host.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
#define UNSERIALIZE_SCALAR(scalar)
void serialize(CheckpointOut &cp) const override
Serialize an object.
#define SERIALIZE_SCALAR(scalar)
bool shiftDown
is the shift key currently down
const std::vector< uint8_t > ID
void send(const uint8_t *data, size_t size)
Send data from a PS/2 device to a host.
std::ostream CheckpointOut
void keyPress(uint32_t key, bool down) override
Called when the vnc server receives a key press event from the client.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void serialize(CheckpointOut &cp) const override
Serialize an object.
bool bool std::list< uint8_t > & keys
bool enabled
Is the device enabled?
void keySymToPs2(uint32_t key, bool down, bool &cur_shift, std::list< uint8_t > &keys)
T bits(T val, int first, int last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it...