Can I stop space and enter from toggling my checkbutton? [Godot]

  • Thread starter Thread starter Darkmisc
  • Start date Start date
  • Tags Tags
    godot
Click For Summary
SUMMARY

The discussion addresses the issue of the Space and Enter keys unintentionally toggling a checkbutton in a Godot game. Users have not assigned these keys to the checkbutton, yet they trigger its action. Solutions proposed include using a keyboard re-mapper or coding input events to prevent the toggling action. Additionally, separating the checkbox GUI from the game screen is suggested to avoid this conflict.

PREREQUISITES
  • Familiarity with Godot Engine and its UI components
  • Understanding of input event handling in game development
  • Basic knowledge of JavaScript if applicable to web apps
  • Experience with keyboard remapping tools like AutoHotkey
NEXT STEPS
  • Research Godot Engine's input event handling documentation
  • Learn how to implement custom input actions in Godot
  • Explore AutoHotkey for keyboard remapping solutions
  • Investigate best practices for UI separation in game design
USEFUL FOR

Game developers using Godot Engine, particularly those dealing with UI interactions and input management in their projects.

Darkmisc
Messages
222
Reaction score
31
TL;DR
I use space and enter as buttons for jump and shoot respectively. I have a checkbutton in my game for toggling the visibility of a display. It turns out space and enter also toggle my checkbutton.
Hi everyone

I use space and enter as buttons for jump and shoot respectively. I have a checkbutton in my game for toggling the visibility of a display. It turns out space and enter also toggle my checkbutton. I didn't code for space and enter to do this. I can't find anywhere on the inspector where keys are assigned to the checkbutton.

So far as I'm aware, no other keys toggle my checkbutton. I could change my keys for jump and shoot, but space and enter seem to be the best keys for this.

Is there anyway to stop space and enter from toggling my checkbutton?Thanks
 
Technology news on Phys.org
Clunky fix, but you could use a keyboard re-mapper.
 
  • Like
Likes robphy and Darkmisc
What language and UI framework are you using?
Later: Failed to notice [Godot] stuck at the end of the subject title.
 
Last edited:
place your checkbox gui stuff on a separate screen from your game so that won't happen.

I'm assuming you're using javascript in a web app.

Here's the Godot Engine info on checkbox

https://docs.godotengine.org/en/stable/classes/class_checkbox.html

Maybe by using a checkbutton and toggling it with code will solve this issue as you have to use a mouse to give it focus and then to press it.
 
Darkmisc said:
I didn't code for space and enter to do this.
What if you do code those input events to do something with your checkbutton? Either "don't do anything" or "undo toggling action" might do the trick.
 
  • Like
Likes robphy, Wrichik Basu, Darkmisc and 2 others
hmmm27 said:
Clunky fix, but you could use a keyboard re-mapper.

jack action said:
What if you do code those input events to do something with your checkbutton? Either "don't do anything" or "undo toggling action" might do the trick.

Possibly useful: https://www.autohotkey.com/docs/v1/misc/Override.htm
 
  • Like
Likes hmmm27 and Darkmisc

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
10
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K