mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
api: dump key binding strings (#606)
Print out human readable text for vKey when dumping bindings.
This commit is contained in:
@@ -2569,9 +2569,10 @@ void dump_button_bindings(std::vector<Button> *buttons) {
|
||||
|
||||
if (button->isNaive()) {
|
||||
log_misc(
|
||||
"rawinput", " [{}] dev=Naive, vkey={}",
|
||||
"rawinput", " [{}] dev=Naive, vkey={} ({})",
|
||||
button->getName(),
|
||||
button->getVKey()
|
||||
button->getVKey(),
|
||||
button->getVKeyString()
|
||||
);
|
||||
} else {
|
||||
log_misc(
|
||||
@@ -2584,16 +2585,25 @@ void dump_button_bindings(std::vector<Button> *buttons) {
|
||||
}
|
||||
|
||||
for (auto& alt : button->getAlternatives()) {
|
||||
if (alt.getVKey() == INVALID_VKEY) {
|
||||
if (!alt.isValid()) {
|
||||
continue;
|
||||
}
|
||||
log_misc(
|
||||
"rawinput", " [{}] (alt) dev={}, vkey={}, analogtype={}",
|
||||
button->getName(),
|
||||
alt.isNaive() ? "Naive" : alt.getDeviceIdentifier(),
|
||||
alt.getVKey(),
|
||||
static_cast<uint32_t>(alt.getAnalogType())
|
||||
);
|
||||
if (alt.isNaive()) {
|
||||
log_misc(
|
||||
"rawinput", " [{}] (alt) dev=Naive, vkey={} ({})",
|
||||
alt.getName(),
|
||||
alt.getVKey(),
|
||||
alt.getVKeyString()
|
||||
);
|
||||
} else {
|
||||
log_misc(
|
||||
"rawinput", " [{}] (alt) dev={}, vkey={}, analogtype={}",
|
||||
alt.getName(),
|
||||
alt.getDeviceIdentifier(),
|
||||
alt.getVKey(),
|
||||
static_cast<uint32_t>(alt.getAnalogType())
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user