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

Discussion Overview

The discussion revolves around the issue of the space and enter keys unintentionally toggling a checkbutton in a Godot game, which is used for toggling the visibility of a display. Participants explore potential solutions and workarounds to prevent this behavior without changing the designated functions of the keys for jumping and shooting.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant notes that space and enter are not explicitly coded to toggle the checkbutton, yet they do so.
  • Another suggests using a keyboard re-mapper as a workaround.
  • A participant inquires about the programming language and UI framework being used, later acknowledging the context of Godot.
  • One suggestion is to place the checkbox GUI on a separate screen to avoid the issue.
  • A participant proposes coding input events for space and enter to either do nothing or undo the toggling action of the checkbutton.
  • Another participant reiterates the keyboard re-mapper suggestion and provides a link to a resource on overriding key actions.

Areas of Agreement / Disagreement

Participants present multiple competing views and suggestions, with no consensus on a definitive solution to the issue. Various workarounds are proposed, but the effectiveness of these approaches remains uncertain.

Contextual Notes

Participants assume the use of Godot but do not clarify the specific version or settings that might influence the behavior of the checkbutton. There is also a lack of information on whether any default settings in Godot could be affecting the key bindings.

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   Reactions: 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:
  • Like
Likes   Reactions: Darkmisc
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.
 
  • Like
Likes   Reactions: Darkmisc
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   Reactions: 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   Reactions: 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