moonlight-android
moonlight-android copied to clipboard
[Feature request]: how to send the keyboard Button signal "ESC" to PC in the game?
when open the remote connection for a game, then press the keyboard button "ESC" to quit the game, but the remote connection is broked and moonlight back to the other window.
so how to send the keyboard Button signal "ESC" to PC in the game?
should i modify some code in the file "game.java"?
i add the callback function in the game.java, but it seems can not send the signal to the pc, is it right ?, as follows
@Override
public void onBackPressed() {
if(!prefConfig.touchscreenTrackpad){
byte modifier = 0;
short translated = keyboardTranslator.translate(KeyEvent.KEYCODE_ESCAPE, KeyCharacterMap.VIRTUAL_KEYBOARD);
conn.sendKeyboardInput(translated, KeyboardPacket.KEY_UP, modifier, keyboardTranslator.hasNormalizedMapping(KeyEvent.KEYCODE_ESCAPE, KeyCharacterMap.FULL) ? 0 : MoonBridge.SS_KBE_FLAG_NON_NORMALIZED);
return;
}
super.onBackPressed();
}
i think may be should provide some interface or funtion to send the keyboard key signals
There's a pr for adding an interface which looks to be on the agenda to being merged in the future
If you're still able to open a stream I use Hackers keyboard to get the ESC key to be pass through.