Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only grab input devices if they are keyboards #737

Merged
merged 1 commit into from Feb 24, 2019
Merged

Only grab input devices if they are keyboards #737

merged 1 commit into from Feb 24, 2019

Conversation

hhromic
Copy link
Contributor

@hhromic hhromic commented Feb 24, 2019

Description

The current evdev input implementation attempts to grab (EVIOCGRAB) every device it finds. This is required for the CTRL+C combo to not interrupt Moonlight when streaming. However, other devices that are not keyboards, i.e. gamepads, do not require this grabbing, and doing so prevent other external applications from using them concurrently. This situation can happen for example when monitoring the gamepad for activity with the purpose of turning it off as done in WIP work in RetroPie for DS3 controllers.

This PR makes the grabbing code to be more specific and only grab keyboard-type devices in evdev_create(). Furthermore, the is_keyboard boolean is promoted to the input_device struct so it can be used in evdev_start() as well. These are the only two places where EVIOCGRAB is issued.

Tested using a real keyobard, a DS3 controller and a simple button input device on a Raspberry Pi 3 B+.

Purpose

Prevent Moonlight from grabbing input devices that are not keyboards, allowing them to be used by other external applications concurrently.

@irtimmer irtimmer merged commit 212eac6 into moonlight-stream:master Feb 24, 2019
@hhromic hhromic deleted the fix-grabbing branch February 24, 2019 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants