How can I add a hover animation for buttons during selection using physical key presses?

In my game, I added animation for button selection (link to tutorial - “https://youtu.be/vzCAShZw6xg?si=l4AAAU2mXvWsLL7h”), and I also made it possible to select buttons using physical keys (link to tutorial - “https://youtu.be/ZrlWzhnh2SQ?si=j73YeuiFPgTJDaWP”). But unfortunately, they don’t work together, and the hover animation only plays when I hover the mouse cursor and doesn’t show up during physical selection. How can I fix this?

You have to use the focus_entered/exited-signal for physical-key presses. for your tutorial implementation you can use this:

if button.is_hovered() or button.has_focus():