mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-02-25 21:41:06 +00:00
Fix Stuck Modifiers on Disconnection
This commit is contained in:
parent
a081a9f5c4
commit
71b214ca43
@ -402,6 +402,13 @@ void passthrough(std::shared_ptr<input_t> &input, std::vector<std::uint8_t> &&in
|
||||
task_pool.push(passthrough_helper, input, util::cmove(input_data));
|
||||
}
|
||||
|
||||
void reset(){
|
||||
for(auto& kp : key_press){
|
||||
platf::keyboard(platf_input, kp.first & 0x00FF, true);
|
||||
key_press[kp.first] = false;
|
||||
}
|
||||
}
|
||||
|
||||
void init() {
|
||||
platf_input = platf::input();
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ namespace input {
|
||||
struct input_t;
|
||||
|
||||
void print(void *input);
|
||||
void reset();
|
||||
void passthrough(std::shared_ptr<input_t> &input, std::vector<std::uint8_t> &&input_data);
|
||||
|
||||
void init();
|
||||
|
@ -885,6 +885,8 @@ state_e state(session_t &session) {
|
||||
void stop(session_t &session) {
|
||||
while_starting_do_nothing(session.state);
|
||||
|
||||
//Reset input on session stop to avoid stuck repeated keys
|
||||
input::reset();
|
||||
auto expected = state_e::RUNNING;
|
||||
auto already_stopping = !session.state.compare_exchange_strong(expected, state_e::STOPPING);
|
||||
if(already_stopping) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user