Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/platform/windows/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ struct input_raw_t {

vigem_t *vigem;
HKL keyboard_layout;
HKL active_layout;
};

input_t input() {
Expand All @@ -197,6 +198,13 @@ input_t input() {
raw.keyboard_layout = NULL;
}

// Activate layout for current process only
raw.active_layout = ActivateKeyboardLayout(raw.keyboard_layout, KLF_SETFORPROCESS);
if(!raw.active_layout) {
BOOST_LOG(warning) << "Unable to activate US English keyboard layout for scancode translation. Keyboard input may not work in games."sv;
raw.keyboard_layout = NULL;
}

return result;
}

Expand Down