moonlight-qt
moonlight-qt copied to clipboard
[Moonlight 5.0] Keystrokes sent from AppleScript are passed incorrectly to remote server
Describe the bug Moonlight 5.0 is not interpreting and passing keystrokes sent from AppleScript to the remote server correctly. "!@#$ QWERTY asdf 1234" is received by the remote PC as "1234 qwerty asdf 1234."
Special characters and uppercase characters are all received as though the shift key was never pressed. Furthermore, I have created/tested AppleScripts with the "using shift down" modifier, and there is no change in what is received by the remote computer. I never experienced this issue until installing Moonlight 5.0. I have confirmed that v4.3.1 does not have this issue, as I have rolled back since the functionality of sending capitalized letters and special characters is required for my environment.
Note: Typing from the client computer's keyboard (instead of using AppleScript to simulate typing) results in all characters being interpreted by the server PC correctly. This odd behavior that I believe only exists in Moonlight 5.0 is exclusively related to sending and typing text via AppleScript Keystroke or Keycode commands.
Steps to reproduce
- Open Notepad on a server running Sunshine or Gamestream and set the notepad application as the primary focus on the remote computer.
- Run the following AppleScript from the client Mac:
set output_chat_message to "!@#$ QWERTY asdf 1234"
tell application "Moonlight" to activate
tell application "System Events"
repeat with thisChar in output_chat_message
keystroke thisChar
delay 0.01
end repeat
key code 76 #enter
end tell
Result:
Screenshots
Affected games This has not been tested in any specific game as I expect this will impact all programs when conditions outlined above are met.
Other Moonlight clients N/A
Moonlight settings (please complete the following information)
- Have any settings been adjusted from defaults?
- Unsure, as I have toggled many settings in attempts to find a solution.
- If so, which settings have been changed? N/A
- My current settings shown here:
- My current settings shown here:
Client PC details (please complete the following information)
- OS: MacOS Sonoma 14.0
- Moonlight Version: 5.0
- GPU: Apple Silicon M1 Max
Server PC details (please complete the following information)
- OS: Windows 11 Pro 22H2
- GeForce Experience version: 3.27.0.112
- Nvidia GPU driver: 545.84
Additional context I have not encountered this issue in previous versions of Moonlight. This issue seems to be exclusive to the latest version, Moonlight 5.0.
I suspect the breakage is caused by this change to SDL: https://github.com/libsdl-org/SDL/commit/1c2f825230d8a1d406179f80192e3421054d688b
Nothing else between v4.3.1 and v5.0.0 seems relevant.
I greatly appreciate your input. I'd love to try and troubleshoot this, but I am way out of my depth on this subject.
Just to update, the bug is still in version 5.01.
I've encountered the same issue. Modifier keys are not passed to the host machine. I'm trying to trigger Moonlight shortcuts with AppleScript. For example, the following command does no longer terminate my session:
tell application "System Events" to keystroke "q" using {control down, option down, shift down}
Here is an Applescript that types the contents of the client's clipboard into the remote PC. Sadly, this script cannot be reliably used on any version of Moonlight newer than 4.3.1:
set output_message to the clipboard as string
tell application "System Events"
repeat with thisChar in output_message
keystroke thisChar
delay 0.01
end repeat
end tell
I invoke this applescript from a streamdeck, but this could easliy be used from a hotkey or via shortcuts. I wish I understood enough about how Moonlight is built to investigate this issue or try to fix.
This was an SDL bug and should be fixed with the latest dependency sync. Please test https://ci.appveyor.com/project/cgutman/moonlight-qt/builds/49211978/job/2exqqybbsko35tww/artifacts
It's working again with the new version. Thank you very much! 👍
This was an SDL bug and should be fixed with the latest dependency sync. Please test https://ci.appveyor.com/project/cgutman/moonlight-qt/builds/49211978/job/2exqqybbsko35tww/artifacts
FIXED! THANK YOU!
Released in v6.0.0