-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
[BUG] Lost focus when pressing the Escape key #137
Comments
My investigations into this matter have not yelded any result. Apparently, there is an open question on StackOverflow for the root cause of this problem, and hopefully it will receive an answer soon. |
Yes, that was me who asked that question :) |
I just noticed that having the electron application open causes it to grab the escape key, preventing me from using it outside of the app in any way. This could be specific to X11 though. |
Not sure about the other environments, but I had to downgrade the release from 1.7.0 to 1.5.2 to not have that ESC key issue anymore. I remember facing the same problem on 1.6.0. So something must have changed between 1.5.2 and +1.6.0. |
What about downgrading the version of Electron as a hotfix? |
It's been an issue for some people even before 1.5.2. GFN handles input locking very weirdly and this kind of issues appears for some but not for others. And whenever I make a fix which seems to work well for me and for others that had the issue before, it's not long until other people report this happening where before it didn't. There's another problem with using older electron versions: there's several high-risk security vulnerabilities present which have since been fixed in newer versions. The best bet would be to finally found a universal and proper fix but so far I wasn't able to. |
Right now, I'm using chromium, as it started working again recently. The issue doesn't exist there. |
Any progress at all on this? It’s an exceedingly annoying bug as it seems to lock out using the escape key in any other app as well... |
I thought I had reported this before, maybe not here anyway. |
Maybe its something with the full screen mode in chrome, the default hotkey to exit it is esc. |
Hi, Looked through some of the files to find mention of the Escape key and i found this in /opt/geforcenow-electron/resources/app/scripts/main.js `globalShortcut.register('Esc', async () => {
I'm not a programmer so i dont know if modifying something in here would help in disabling the whole losing focus issue. |
Yes, in some way it does, if you remove the lines, the esc input is completely gone. Without these lines you cannot open pause menus or do anything else that needs the key to be pressed. |
Is there any logic behind the lines repeating though? or is there some other file where the Esc key is set to be the lose focus key and we can change it to a combination like Shift+Esc or F9 or something not used by the game? |
I don't know why the code is there multiple times, it worked also with only one time. I didn't find anything else in the code mentioning the esc key, but it's also not my code, so its possible I've missed something. |
You may be onto something here! There’s some discussion about this over on StackOverflow; it seems it’s necessary to specify |
Ok, it seems the current solution is a hacky way to get both the in-game response to the Escape key being pressed as well as for GFN to display its own prompt for exiting the session at the same time. Simply using Using only Using only It would be interesting to know the intended behavior on Windows: when exactly does the GFN prompt come up, resulting in loss of focus? Does the user have to press escape several times? It’s possible GFN detects if the user sends any other input after pressing Escape, presumably indicating that they are navigating the in-game menu so that the prompt timer is cancelled; maybe that’s not properly implemented in the Electron wrapper here? Just speculating. |
Well assuming that GFN can be used on windows in a browser I doubt whoever made it didn't think of the possibility of someone using the escape key within games for menus and the like. Then again it may be an oversight or just how electron apps work on Linux. Still I hope some sort of fix is found, even if it needs some tinkering |
Yeah, it seems to be related specifically to the electron implementation. Although, again, how does Escape behave on Windows? How does GFN differentiate between whether you want to send the keypress only as an in-game event or as a way to summon the GFN prompt to exit the session? I don’t have access to a Windows machine at the moment, but if someone here does, it might turn out to be pertinent information. |
I tried it out on a fresh install of Windows 11 in a virtual machine. The issue is also there in Windows. You mean the Javascript error with the GFN Prompt right? |
Is this issue still persisting in the latest version? |
Yes it is @hmlendea , just tried it out with the new appimage. Thanks for asking :) |
I got some news on this issue; don't know if it's helpful, but maybe it is. Furthermore, I got some errors on while starting with |
is there any update on the issue? it gets really frustrating on most games out there |
A workaround currently might be that sometimes the escape key reacts, if it is pressed multiple times in quick succession. |
Any update on this? |
i found a fix! just has to be set to be ran every time the page "reloads" or anything so that it stays effective Note: This was tested on Plasma X11 and Wayland as well as on Hyprland if (navigator.keyboard && navigator.keyboard.lock){
navigator.keyboard.lock(['Escape'])
} else {
console.log("Your app doesn't support navigator.keyboard")
} |
Describe the bug
Whenever the
Escape
key is pressed, the focus / mouse pointer lock is lost and requires an additional click on the game streaming window to be able to send input again.Both cursors (the one from the stream, and the local/system one) are visible, but are not in sync - the game one is frozen.
Does not break the game, but it is an annoyance.
To Reproduce
Escape
keyScreenshots
No response
Operatingsystem
Arch Linux
Desktop Environment
GNOME 42.1
Installation method
flatpak
Version
1.7.0
Additional context
No response
The text was updated successfully, but these errors were encountered: