Giter Club home page Giter Club logo

Comments (2)

cgutman avatar cgutman commented on June 4, 2024

The problem with this is that some platforms (Windows and macOS) don't seem to allow applications to suppress media keys. The normal keyboard capture mechanisms that apply to other keyboard shortcuts don't work on media keys, so we might be able to send them to the remote PC but they would also act on the local PC too.

I am mostly interested in the source code that is used to capture keys on the host, and how it does filtering (if any) for which keys to send through and which to not.

Moonlight itself doesn't filter the keys. We use SDL2's SDL_SetWindowKeyboardGrab() API which uses per-platform backends to handle capture. For example, it uses aWH_KEYBOARD_LL hook on Windows and the keyboard-shortcuts-inhibit-unstable-v1 Wayland protocol on Linux.

from moonlight-qt.

levouh avatar levouh commented on June 4, 2024

It seems like it would potentially be a worse user experience to send the key press to both the client and host system, right? At least without explicit consent from the user. And even then, I'm not sure something like having a program on the client "eat" the key press would work (as perhaps this would also prevent it from being registered by the client at all), but I would need to experiment with it.

I figured an easier approach, especially since I imagine I am in the minority as far as desiring this behavior goes, might be to just use something like AHK and ControlSend (which allows sending keys to a specific application) to "only" send the key press to Moonlight. It seems it gets ignored (host system sees no key press come through) presumably because SDL2 standing somewhere in between the emulated key press on the client and the host system.

Of course I can take things like F13-F24 and map those to deliver the correct key presses to the host system as well so it is not out of reach by any means. Do you think this is something even worth pursuing a "fix" for (as you noted, sending them to the host/remote PC)?

from moonlight-qt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.