Closed simonecurci closed 3 months ago
:(
More power, more responsability.
I always inssite ion KISS principle, but ytoug peoople want to follow their way.. it’s naturals.. but sometimes Hard
On 29 Jun 2024, at 15:56, Simone Curci @.***> wrote:
This PR addresses a critical bug in our JavaFX GUI related to key press event handling. The issue was that the onKeyPressed event on the root AnchorPane was not being triggered when the Enter key was pressed. This is a crucial functionality for our application as it is responsible for triggering the continueAction() method, which is essential for the progression of the game.
The root cause of the issue was that the root AnchorPane was not receiving focus, and in JavaFX, only the node that has focus can receive keyboard input events. This was due to the fact that one of the buttons was being selected by default when the scene was loaded, thereby receiving the focus instead of the root AnchorPane.
The fix involves setting the focusTraversable property of each button to false, which prevents them from receiving focus when the scene is loaded. This allows the root AnchorPane to receive the focus and hence the keyboard input events. Without this fix, the game cannot progress past the initial scene, making it impossible for users to interact with the application beyond this point. Therefore, it is of utmost importance that this bug is fixed to ensure the proper functioning of our application.
You can view, comment on, or merge this pull request online at:
https://github.com/PiervitoCreanza/IS24-AM02/pull/222
Commit Summary
497ada5 https://github.com/PiervitoCreanza/IS24-AM02/pull/222/commits/497ada5cad1d83ebfbe1eba66321278fbbd965b6 CRITICAL BUG FIX File Changes (1 file https://github.com/PiervitoCreanza/IS24-AM02/pull/222/files) M src/main/java/it/polimi/ingsw/view/gui/fxml/InitSelectPionScene.fxml https://github.com/PiervitoCreanza/IS24-AM02/pull/222/files#diff-5de6464d81abb204957e192bdaf37404d6f64561c5ca1f241d247a1eac00a3bb (5) Patch Links:
https://github.com/PiervitoCreanza/IS24-AM02/pull/222.patch https://github.com/PiervitoCreanza/IS24-AM02/pull/222.diff — Reply to this email directly, view it on GitHub https://github.com/PiervitoCreanza/IS24-AM02/pull/222, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA64MJ5XHETPUKXSD3NGLL3ZJ24IBAVCNFSM6AAAAABKDHCVYSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM4DCNZWGUYDAMA. You are receiving this because you are subscribed to this thread.
ing. Conti G. Enrico @.*** Ordine Ingegneri di Monza al n. A894 Certing MBB-2430-IT20
PIVA 02119300966
C.FISC. CNTGNR63A23M052W
via Duca degli Abruzzi 29
20900 MONZA MB ITALY
0039-039-324723
www.ingconti.com
Pec: @.***
CODICE DESTINATARIO KRRH6B9
This PR addresses a critical bug in our JavaFX GUI related to key press event handling. The issue was that the onKeyPressed event on the root AnchorPane was not being triggered when the Enter key was pressed. This is a crucial functionality for our application as it is responsible for triggering the continueAction() method, which is essential for the progression of the game.
The root cause of the issue was that the root AnchorPane was not receiving focus, and in JavaFX, only the node that has focus can receive keyboard input events. This was due to the fact that one of the buttons was being selected by default when the scene was loaded, thereby receiving the focus instead of the root AnchorPane.
The fix involves setting the focusTraversable property of each button to false, which prevents them from receiving focus when the scene is loaded. This allows the root AnchorPane to receive the focus and hence the keyboard input events. Without this fix, the game cannot progress past the initial scene, making it impossible for users to interact with the application beyond this point. Therefore, it is of utmost importance that this bug is fixed to ensure the proper functioning of our application.