Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libtcg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anton
libtcg
Commits
11c7fa7f
Commit
11c7fa7f
authored
10 years ago
by
Gerd Hoffmann
Browse files
Options
Downloads
Patches
Plain Diff
input: add qemu_input_key_number_to_qcode
Signed-off-by:
Gerd Hoffmann
<
kraxel@redhat.com
>
parent
f5c0ab13
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/ui/input.h
+1
-0
1 addition, 0 deletions
include/ui/input.h
ui/input-keymap.c
+8
-3
8 additions, 3 deletions
ui/input-keymap.c
with
9 additions
and
3 deletions
include/ui/input.h
+
1
−
0
View file @
11c7fa7f
...
...
@@ -36,6 +36,7 @@ InputEvent *qemu_input_event_new_key(KeyValue *key, bool down);
void
qemu_input_event_send_key
(
QemuConsole
*
src
,
KeyValue
*
key
,
bool
down
);
void
qemu_input_event_send_key_number
(
QemuConsole
*
src
,
int
num
,
bool
down
);
void
qemu_input_event_send_key_qcode
(
QemuConsole
*
src
,
QKeyCode
q
,
bool
down
);
int
qemu_input_key_number_to_qcode
(
uint8_t
nr
);
int
qemu_input_key_value_to_number
(
const
KeyValue
*
value
);
int
qemu_input_key_value_to_qcode
(
const
KeyValue
*
value
);
int
qemu_input_key_value_to_scancode
(
const
KeyValue
*
value
,
bool
down
,
...
...
This diff is collapsed.
Click to expand it.
ui/input-keymap.c
+
8
−
3
View file @
11c7fa7f
...
...
@@ -129,7 +129,7 @@ static const int qcode_to_number[] = {
[
Q_KEY_CODE_MAX
]
=
0
,
};
static
int
number_to_qcode
[
0x
ff
];
static
int
number_to_qcode
[
0x
100
];
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
)
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment