mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
input: add qemu_input_key_number_to_qcode
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
f5c0ab1312
commit
11c7fa7fa6
2 changed files with 9 additions and 3 deletions
|
@ -129,7 +129,7 @@ static const int qcode_to_number[] = {
|
|||
[Q_KEY_CODE_MAX] = 0,
|
||||
};
|
||||
|
||||
static int number_to_qcode[0xff];
|
||||
static int number_to_qcode[0x100];
|
||||
|
||||
int qemu_input_key_value_to_number(const KeyValue *value)
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ int qemu_input_key_value_to_number(const KeyValue *value)
|
|||
}
|
||||
}
|
||||
|
||||
int qemu_input_key_value_to_qcode(const KeyValue *value)
|
||||
int qemu_input_key_number_to_qcode(uint8_t nr)
|
||||
{
|
||||
static int first = true;
|
||||
|
||||
|
@ -155,11 +155,16 @@ int qemu_input_key_value_to_qcode(const KeyValue *value)
|
|||
}
|
||||
}
|
||||
|
||||
return number_to_qcode[nr];
|
||||
}
|
||||
|
||||
int qemu_input_key_value_to_qcode(const KeyValue *value)
|
||||
{
|
||||
if (value->kind == KEY_VALUE_KIND_QCODE) {
|
||||
return value->qcode;
|
||||
} else {
|
||||
assert(value->kind == KEY_VALUE_KIND_NUMBER);
|
||||
return number_to_qcode[value->number];
|
||||
return qemu_input_key_number_to_qcode(value->number);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue